You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@openjpa.apache.org by Simone Gianni <si...@apache.org> on 2009/09/17 02:36:35 UTC

StreamingLOB and Derby/Hsql

Hi all,
I've been experimenting with the streaming LOB on Apache Derby and Hsql. 
I'm using OpenJPA 1.2.0.

On Hsql, it is not supported because it does not support select for update.

On Derby 10.1.2.1 (reported as supported in 
http://openjpa.apache.org/builds/1.2.0/apache-openjpa-1.2.0/docs/manual/manual.html#supported_databases) 
and up to 10.2.2.0 it does not work. An exception [1] is thrown when 
trying persisting.

On Derby 10.4.1.3, 10.4.2.0, 10.3.2.1 it fails with an exception, but 
not when writing, during read operation [2]. Looking at derby source, 
seems like an IOException is thrown when stream value is null.

The same application works perfectly on different versions of MySQL, 
both on windows and linux.

Has anyone managed to have streaming lob working on Derby? Am I missing 
some configuration option?

Simone



[1]
Caused by: SQL Exception: Feature not implemented: no details.
        at org.apache.derby.impl.jdbc.Util.newEmbedSQLException(Unknown 
Source)
        at org.apache.derby.impl.jdbc.Util.newEmbedSQLException(Unknown 
Source)
        at org.apache.derby.impl.jdbc.Util.notImplemented(Unknown Source)
        at org.apache.derby.impl.jdbc.EmbedBlob.setBinaryStream(Unknown 
Source)
        at 
org.apache.openjpa.jdbc.sql.DBDictionary.updateBlob(DBDictionary.java:4310)
        at 
org.apache.openjpa.jdbc.meta.strats.LobFieldStrategy.customInsert(LobFieldStrategy.java:112)
        at 
org.apache.openjpa.jdbc.meta.FieldMapping.customInsert(FieldMapping.java:701)
        at 
org.apache.openjpa.jdbc.kernel.AbstractUpdateManager$CustomMapping.execute(AbstractUpdateManager.java:352)
        at 
org.apache.openjpa.jdbc.kernel.AbstractUpdateManager.flush(AbstractUpdateManager.java:94)

[2]
Caused by: java.io.IOException
        at 
org.apache.derby.iapi.services.io.NewByteArrayInputStream.read(Unknown 
Source)
        at java.io.InputStream.read(InputStream.java:85)


-- 
Simone Gianni            CEO Semeru s.r.l.           Apache Committer
http://www.simonegianni.it/


Re: StreamingLOB and Derby/Hsql

Posted by Jeremy Bauer <te...@gmail.com>.
Rev 816287 corrected many of the Oracle failures, but at least one issue
remains for that platform.

-Jeremy

On Mon, Sep 21, 2009 at 2:35 PM, Donald Woods <dw...@apache.org> wrote:

> After the focus on cleaning up failing junits on non-Derby databases this
> month, TestReaderLob is passing now on MySQL and only has one failure on
> Oracle, but still has 5 failures on MSSQL....
>
> Not sure which svn check-in resolved it, as it could have been r816287 for
> Oracle or a number of the other test fixes by Fay to correct case sensitive
> column/table names or schema naming fixes....
>
>
> -Donald
>
>
>
> Miłosz Tylenda wrote:
>
>> Hi Simone,
>>
>> OpenJPA currently supports (judging from test cases) streaming LOB with
>> MySQL, Oracle, PostgreSQL and SQL Server. However, even with these databases
>> there are bugs to fix. OPENJPA-1248 [1] contains a few stack traces some of
>> which are similar to yours. Thus the exception you are getting from a newer
>> Derby might be an OpenJPA fault.
>>
>> [1] https://issues.apache.org/jira/browse/OPENJPA-1248
>>
>> Regards,
>> Milosz
>>
>>  Hi all,
>>> I've been experimenting with the streaming LOB on Apache Derby and Hsql.
>>> I'm using OpenJPA 1.2.0.
>>>
>>> On Hsql, it is not supported because it does not support select for
>>> update.
>>>
>>> On Derby 10.1.2.1 (reported as supported in
>>> http://openjpa.apache.org/builds/1.2.0/apache-openjpa-1.2.0/docs/manual/manual.html#supported_databases)
>>> and up to 10.2.2.0 it does not work. An exception [1] is thrown when trying
>>> persisting.
>>>
>>> On Derby 10.4.1.3, 10.4.2.0, 10.3.2.1 it fails with an exception, but not
>>> when writing, during read operation [2]. Looking at derby source, seems like
>>> an IOException is thrown when stream value is null.
>>>
>>> The same application works perfectly on different versions of MySQL, both
>>> on windows and linux.
>>>
>>> Has anyone managed to have streaming lob working on Derby? Am I missing
>>> some configuration option?
>>>
>>> Simone
>>>
>>>
>>>
>>> [1]
>>> Caused by: SQL Exception: Feature not implemented: no details.
>>>        at org.apache.derby.impl.jdbc.Util.newEmbedSQLException(Unknown
>>> Source)
>>>        at org.apache.derby.impl.jdbc.Util.newEmbedSQLException(Unknown
>>> Source)
>>>        at org.apache.derby.impl.jdbc.Util.notImplemented(Unknown Source)
>>>        at org.apache.derby.impl.jdbc.EmbedBlob.setBinaryStream(Unknown
>>> Source)
>>>        at
>>> org.apache.openjpa.jdbc.sql.DBDictionary.updateBlob(DBDictionary.java:4310)
>>>        at
>>> org.apache.openjpa.jdbc.meta.strats.LobFieldStrategy.customInsert(LobFieldStrategy.java:112)
>>>        at
>>> org.apache.openjpa.jdbc.meta.FieldMapping.customInsert(FieldMapping.java:701)
>>>        at
>>> org.apache.openjpa.jdbc.kernel.AbstractUpdateManager$CustomMapping.execute(AbstractUpdateManager.java:352)
>>>        at
>>> org.apache.openjpa.jdbc.kernel.AbstractUpdateManager.flush(AbstractUpdateManager.java:94)
>>>
>>> [2]
>>> Caused by: java.io.IOException
>>>        at
>>> org.apache.derby.iapi.services.io.NewByteArrayInputStream.read(Unknown
>>> Source)
>>>        at java.io.InputStream.read(InputStream.java:85)
>>>
>>>
>>> --
>>> Simone Gianni            CEO Semeru s.r.l.           Apache Committer
>>> http://www.simonegianni.it/
>>>
>>>
>>>
>>

Re: StreamingLOB and Derby/Hsql

Posted by Donald Woods <dw...@apache.org>.
After the focus on cleaning up failing junits on non-Derby databases 
this month, TestReaderLob is passing now on MySQL and only has one 
failure on Oracle, but still has 5 failures on MSSQL....

Not sure which svn check-in resolved it, as it could have been r816287 
for Oracle or a number of the other test fixes by Fay to correct case 
sensitive column/table names or schema naming fixes....


-Donald


Miłosz Tylenda wrote:
> Hi Simone,
> 
> OpenJPA currently supports (judging from test cases) streaming LOB with MySQL, Oracle, PostgreSQL and SQL Server. However, even with these databases there are bugs to fix. OPENJPA-1248 [1] contains a few stack traces some of which are similar to yours. Thus the exception you are getting from a newer Derby might be an OpenJPA fault.
> 
> [1] https://issues.apache.org/jira/browse/OPENJPA-1248
> 
> Regards,
> Milosz
> 
>> Hi all,
>> I've been experimenting with the streaming LOB on Apache Derby and Hsql. 
>> I'm using OpenJPA 1.2.0.
>>
>> On Hsql, it is not supported because it does not support select for update.
>>
>> On Derby 10.1.2.1 (reported as supported in 
>> http://openjpa.apache.org/builds/1.2.0/apache-openjpa-1.2.0/docs/manual/manual.html#supported_databases) 
>> and up to 10.2.2.0 it does not work. An exception [1] is thrown when 
>> trying persisting.
>>
>> On Derby 10.4.1.3, 10.4.2.0, 10.3.2.1 it fails with an exception, but 
>> not when writing, during read operation [2]. Looking at derby source, 
>> seems like an IOException is thrown when stream value is null.
>>
>> The same application works perfectly on different versions of MySQL, 
>> both on windows and linux.
>>
>> Has anyone managed to have streaming lob working on Derby? Am I missing 
>> some configuration option?
>>
>> Simone
>>
>>
>>
>> [1]
>> Caused by: SQL Exception: Feature not implemented: no details.
>>         at org.apache.derby.impl.jdbc.Util.newEmbedSQLException(Unknown 
>> Source)
>>         at org.apache.derby.impl.jdbc.Util.newEmbedSQLException(Unknown 
>> Source)
>>         at org.apache.derby.impl.jdbc.Util.notImplemented(Unknown Source)
>>         at org.apache.derby.impl.jdbc.EmbedBlob.setBinaryStream(Unknown 
>> Source)
>>         at 
>> org.apache.openjpa.jdbc.sql.DBDictionary.updateBlob(DBDictionary.java:4310)
>>         at 
>> org.apache.openjpa.jdbc.meta.strats.LobFieldStrategy.customInsert(LobFieldStrategy.java:112)
>>         at 
>> org.apache.openjpa.jdbc.meta.FieldMapping.customInsert(FieldMapping.java:701)
>>         at 
>> org.apache.openjpa.jdbc.kernel.AbstractUpdateManager$CustomMapping.execute(AbstractUpdateManager.java:352)
>>         at 
>> org.apache.openjpa.jdbc.kernel.AbstractUpdateManager.flush(AbstractUpdateManager.java:94)
>>
>> [2]
>> Caused by: java.io.IOException
>>         at 
>> org.apache.derby.iapi.services.io.NewByteArrayInputStream.read(Unknown 
>> Source)
>>         at java.io.InputStream.read(InputStream.java:85)
>>
>>
>> -- 
>> Simone Gianni            CEO Semeru s.r.l.           Apache Committer
>> http://www.simonegianni.it/
>>
>>
> 

Re: StreamingLOB and Derby/Hsql

Posted by Miłosz Tylenda <mt...@o2.pl>.
Hi Simone,

OpenJPA currently supports (judging from test cases) streaming LOB with MySQL, Oracle, PostgreSQL and SQL Server. However, even with these databases there are bugs to fix. OPENJPA-1248 [1] contains a few stack traces some of which are similar to yours. Thus the exception you are getting from a newer Derby might be an OpenJPA fault.

[1] https://issues.apache.org/jira/browse/OPENJPA-1248

Regards,
Milosz

> Hi all,
> I've been experimenting with the streaming LOB on Apache Derby and Hsql. 
> I'm using OpenJPA 1.2.0.
> 
> On Hsql, it is not supported because it does not support select for update.
> 
> On Derby 10.1.2.1 (reported as supported in 
> http://openjpa.apache.org/builds/1.2.0/apache-openjpa-1.2.0/docs/manual/manual.html#supported_databases) 
> and up to 10.2.2.0 it does not work. An exception [1] is thrown when 
> trying persisting.
> 
> On Derby 10.4.1.3, 10.4.2.0, 10.3.2.1 it fails with an exception, but 
> not when writing, during read operation [2]. Looking at derby source, 
> seems like an IOException is thrown when stream value is null.
> 
> The same application works perfectly on different versions of MySQL, 
> both on windows and linux.
> 
> Has anyone managed to have streaming lob working on Derby? Am I missing 
> some configuration option?
> 
> Simone
> 
> 
> 
> [1]
> Caused by: SQL Exception: Feature not implemented: no details.
>         at org.apache.derby.impl.jdbc.Util.newEmbedSQLException(Unknown 
> Source)
>         at org.apache.derby.impl.jdbc.Util.newEmbedSQLException(Unknown 
> Source)
>         at org.apache.derby.impl.jdbc.Util.notImplemented(Unknown Source)
>         at org.apache.derby.impl.jdbc.EmbedBlob.setBinaryStream(Unknown 
> Source)
>         at 
> org.apache.openjpa.jdbc.sql.DBDictionary.updateBlob(DBDictionary.java:4310)
>         at 
> org.apache.openjpa.jdbc.meta.strats.LobFieldStrategy.customInsert(LobFieldStrategy.java:112)
>         at 
> org.apache.openjpa.jdbc.meta.FieldMapping.customInsert(FieldMapping.java:701)
>         at 
> org.apache.openjpa.jdbc.kernel.AbstractUpdateManager$CustomMapping.execute(AbstractUpdateManager.java:352)
>         at 
> org.apache.openjpa.jdbc.kernel.AbstractUpdateManager.flush(AbstractUpdateManager.java:94)
> 
> [2]
> Caused by: java.io.IOException
>         at 
> org.apache.derby.iapi.services.io.NewByteArrayInputStream.read(Unknown 
> Source)
>         at java.io.InputStream.read(InputStream.java:85)
> 
> 
> -- 
> Simone Gianni            CEO Semeru s.r.l.           Apache Committer
> http://www.simonegianni.it/
> 
> 

Re: StreamingLOB and Derby/Hsql

Posted by Donald Woods <dw...@apache.org>.
Have you tried running with Derby 10.5.1.0 or 10.5.3.0?
Looking at the Derby 10.5.1.1 release notes, there were a lot of 
stream/lob/clob fixes that went in...

I tried running the TestInputStreamLob and TestReaderLob junits in trunk 
against Derby 10.5.3.0 and am seeing the same test failures as with 
MSSQL (10 test failures total while reading from an InputStream object 
from a returned entity), so there is a chance it may work for what you 
need until we have time to resolve the test failures and make any 
additional code updates.


-Donald


Simone Gianni wrote:
> Hi all,
> I've been experimenting with the streaming LOB on Apache Derby and Hsql. 
> I'm using OpenJPA 1.2.0.
> 
> On Hsql, it is not supported because it does not support select for update.
> 
> On Derby 10.1.2.1 (reported as supported in 
> http://openjpa.apache.org/builds/1.2.0/apache-openjpa-1.2.0/docs/manual/manual.html#supported_databases) 
> and up to 10.2.2.0 it does not work. An exception [1] is thrown when 
> trying persisting.
> 
> On Derby 10.4.1.3, 10.4.2.0, 10.3.2.1 it fails with an exception, but 
> not when writing, during read operation [2]. Looking at derby source, 
> seems like an IOException is thrown when stream value is null.
> 
> The same application works perfectly on different versions of MySQL, 
> both on windows and linux.
> 
> Has anyone managed to have streaming lob working on Derby? Am I missing 
> some configuration option?
> 
> Simone
> 
> 
> 
> [1]
> Caused by: SQL Exception: Feature not implemented: no details.
>        at org.apache.derby.impl.jdbc.Util.newEmbedSQLException(Unknown 
> Source)
>        at org.apache.derby.impl.jdbc.Util.newEmbedSQLException(Unknown 
> Source)
>        at org.apache.derby.impl.jdbc.Util.notImplemented(Unknown Source)
>        at org.apache.derby.impl.jdbc.EmbedBlob.setBinaryStream(Unknown 
> Source)
>        at 
> org.apache.openjpa.jdbc.sql.DBDictionary.updateBlob(DBDictionary.java:4310)
>        at 
> org.apache.openjpa.jdbc.meta.strats.LobFieldStrategy.customInsert(LobFieldStrategy.java:112) 
> 
>        at 
> org.apache.openjpa.jdbc.meta.FieldMapping.customInsert(FieldMapping.java:701) 
> 
>        at 
> org.apache.openjpa.jdbc.kernel.AbstractUpdateManager$CustomMapping.execute(AbstractUpdateManager.java:352) 
> 
>        at 
> org.apache.openjpa.jdbc.kernel.AbstractUpdateManager.flush(AbstractUpdateManager.java:94) 
> 
> 
> [2]
> Caused by: java.io.IOException
>        at 
> org.apache.derby.iapi.services.io.NewByteArrayInputStream.read(Unknown 
> Source)
>        at java.io.InputStream.read(InputStream.java:85)
> 
>