Issue Details (XML | Word | Printable)

Key: OPENJPA-130
Type: New Feature New Feature
Status: Resolved Resolved
Resolution: Fixed
Assignee: Ignacio Andreu
Reporter: Patrick Linskey
Votes: 1
Watchers: 1
Operations

If you were logged in you would be able to see more operations.
OpenJPA

Streaming LOB support

Created: 07/Feb/07 07:26 PM   Updated: 12/May/08 09:51 PM
Return to search
Component/s: datacache, jdbc, jpa, kernel
Affects Version/s: None
Fix Version/s: 1.1.0

Time Tracking:
Not Specified

File Attachments:
  Size
Text File Licensed for inclusion in ASF works OPENJPA-130-2.patch 2008-03-20 09:03 PM Ignacio Andreu 9 kB
Text File Licensed for inclusion in ASF works OPENJPA-130-3.patch 2008-05-12 08:57 PM Ignacio Andreu 25 kB
Text File Licensed for inclusion in ASF works OPENJPA-130.patch 2007-09-09 07:00 PM Ignacio Andreu 46 kB
Text File Licensed for inclusion in ASF works OPENJPA-130.patch 2007-08-20 07:19 PM Ignacio Andreu 36 kB

Resolution Date: 12/May/08 09:51 PM


 Description  « Hide
BLOB and CLOB fields can only be mapped in their entirety in OpenJPA. It would be nice to support fields of type java.io.InputStream (for BLOBs) and java.io.Reader (for CLOBs).

The usage pattern could look like so:

@Entity
public class Employee {
    ...
    private InputStream photoStream;

    public void setPhotoStream(InputStream in) {
        photoStream = in;
    }

    public InputStream getPhotoStream() {
        return photoStream;
    }
}

So, when the user wants to provide a stream, she will set the InputStream field, and when the user wants to obtain a stream, she will use the field.

The behavior of such an implementation would be a bit different than how other fields work, in that if the user set the stream and then consumed it within a single transaction, presumably no data would be written out to the database at commit time. But that is the nature of streams.

(FTR, I think that I stole this idea from an email Craig Russell sent out years ago.)

 All   Comments   Work Log   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Patrick Linskey made changes - 01/Mar/07 02:25 AM
Field Original Value New Value
Fix Version/s 1.1.0 [ 12312344 ]
Patrick Linskey made changes - 21/May/07 09:57 PM
Assignee Patrick Linskey [ pcl ]
Patrick Linskey made changes - 18/Jul/07 06:30 PM
Assignee Patrick Linskey [ pcl ] Ignacio Andreu [ plunchete ]
Ignacio Andreu made changes - 20/Aug/07 07:19 PM
Attachment OPENJPA-130.patch [ 12364180 ]
Ignacio Andreu made changes - 09/Sep/07 07:00 PM
Attachment OPENJPA-130.patch [ 12365430 ]
Ignacio Andreu made changes - 20/Mar/08 09:03 PM
Attachment OPENJPA-130-2.patch [ 12378347 ]
Ignacio Andreu made changes - 12/May/08 08:57 PM
Attachment OPENJPA-130-3.patch [ 12381908 ]
Patrick Linskey made changes - 12/May/08 09:51 PM
Resolution Fixed [ 1 ]
Status Open [ 1 ] Resolved [ 5 ]