Uploaded image for project: 'OpenJPA'
  1. OpenJPA
  2. OPENJPA-130

Streaming LOB support

    XMLWordPrintableJSON

Details

    • New Feature
    • Status: Closed
    • Resolution: Fixed
    • None
    • 1.1.0
    • datacache, jdbc, jpa, kernel
    • None

    Description

      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.)

      Attachments

        1. OPENJPA-130-DB2-2.patch
          2 kB
          Fay Wang
        2. OPENJPA-130-DB2.patch
          7 kB
          Fay Wang
        3. OPENJPA-130-3.patch
          25 kB
          Ignacio Andreu
        4. OPENJPA-130-2.patch
          9 kB
          Ignacio Andreu
        5. OPENJPA-130.patch
          36 kB
          Ignacio Andreu
        6. OPENJPA-130.patch
          46 kB
          Ignacio Andreu

        Issue Links

          Activity

            People

              plunchete Ignacio Andreu
              pcl Patrick Linskey
              Votes:
              1 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: