openjpa-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From adamspe <adam...@gmail.com>
Subject Postgres: InputStream LOB Streaming
Date Wed, 30 Apr 2014 22:59:43 GMT
Does anyone have any recent experience with LOB Streaming and postgres?

There seem to be old Jira issues related to it not functioning but all of
the ones I find are closed as if it should work.  I haven't found any recent
threads pertaining to the topic.

I'm using OpenJPA 2.3.0 and Postgres 9.3.1.0

I have an entity with a field annotated like:
    @Column(length=1310720)
    @Persistent(fetch=FetchType.LAZY)
    private InputStream content;

The @Column(length=..) is so that when using against MySQL MEDIUMBLOB is
used instead of BLOB which is too small.

A describe of the table in MySQL shows the column is a 'mediumblob' and when
described for postgres it is an 'integer'.

When I run my code connected to MySQL it works great and I can transfer
BLOBs to/from my table using the InputStream but when I run it against
postgres no complaints are made but no content is stored and of course as a
result I can't read anything that is claimed to have been stored.

The documentation clearly states that it's a known issue for postgres that
you cannot use LOB Streaming when annotating a Reader
"Persistent fields of type java.io.Reader are not supported when using LOB
streaming."

But it says nothing about annotating an InputStream and the LOB Streaming
section of the documentation claims support for Postgres.  I've read the
unit tests (though not sure how to run them) and they would seem to imply
that the InputStream related tests can be run for postgres as well.

Any pointers on what I might be doing wrong would be appreciated.  Maybe
this isn't intended to work?  If so the documentation should be updated to
avoid confusion.

Thanks.



--
View this message in context: http://openjpa.208410.n2.nabble.com/Postgres-InputStream-LOB-Streaming-tp7586300.html
Sent from the OpenJPA Users mailing list archive at Nabble.com.

Mime
View raw message