Subject | exception in ResultSet#getBinaryStream after a commit |
---|---|
Author | Kövér Gábor |
Post date | 2003-09-25T13:35:21Z |
Hi,
I am reading the rows from a ResultSet. During this iteration I have to
commit the transaction (because many database writes occure inside the
loop). I can continue to call next() on the same ResultSet, I can even get
"normal" fields (e.g. strings) from it, but when I call getBinaryStream on
it I get the following exception:
org.firebirdsql.jdbc.FBSQLException: GDS Exception. invalid transaction
handle (expecting explicit transaction start)
at org.firebirdsql.jdbc.FBBlob$FBBlobInputStream.<init>(FBBlob.java:359)
at org.firebirdsql.jdbc.FBBlob$FBBlobInputStream.<init>(FBBlob.java:348)
at org.firebirdsql.jdbc.FBBlob.getBinaryStream(FBBlob.java:168)
at org.firebirdsql.jdbc.FBBlobField.getBinaryStream(FBBlobField.java:107)
at org.firebirdsql.jdbc.FBResultSet.getBinaryStream(FBResultSet.java:491)
at
hu.scriptum.codexml.rdbms.RdbmsBinary.readFromDatabase(RdbmsBinary.java:233)
at hu.scriptum.codexml.rdbms.RdbmsBinary.<init>(RdbmsBinary.java:99)
at hu.scriptum.codexml.rdbms.RdbmsXml.<init>(RdbmsXml.java:66)
at
hu.scriptum.codexml.rdbms.RdbmsTransaction.retrieve(RdbmsTransaction.java:52
4)
at
hu.scriptum.codexml.rdbms.AbstractObjectSet$1.readObject(AbstractObjectSet.j
ava:117)
at
hu.scriptum.codexml.rdbms.ResultSetIterator.moveToNextObject(ResultSetIterat
or.java:51)
at
hu.scriptum.codexml.rdbms.ResultSetIterator.next(ResultSetIterator.java:105)
at
hu.scriptum.codexml.test.ComplexQueryTest.testIterator(ComplexQueryTest.java
:444)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39
)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl
.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at junit.framework.TestCase.runTest(TestCase.java:166)
at junit.framework.TestCase.runBare(TestCase.java:140)
at junit.framework.TestResult$1.protect(TestResult.java:106)
at junit.framework.TestResult.runProtected(TestResult.java:124)
at junit.framework.TestResult.run(TestResult.java:109)
at junit.framework.TestCase.run(TestCase.java:131)
at junit.framework.TestSuite.runTest(TestSuite.java:173)
at junit.framework.TestSuite.run(TestSuite.java:168)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRu
nner.java:392)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.
java:276)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner
.java:167)
at
org.firebirdsql.gds.GDSException: invalid transaction handle (expecting
explicit transaction start)
at org.firebirdsql.jgds.GDS_Impl.openOrCreateBlob(GDS_Impl.java:1340)
at org.firebirdsql.jgds.GDS_Impl.isc_open_blob2(GDS_Impl.java:1323)
at
org.firebirdsql.jca.FBManagedConnection.openBlobHandle(FBManagedConnection.j
ava:867)
at org.firebirdsql.jdbc.FBConnection.openBlobHandle(FBConnection.java:1155)
at org.firebirdsql.jdbc.FBBlob$FBBlobInputStream.<init>(FBBlob.java:356)
at org.firebirdsql.jdbc.FBBlob$FBBlobInputStream.<init>(FBBlob.java:348)
at org.firebirdsql.jdbc.FBBlob.getBinaryStream(FBBlob.java:168)
at org.firebirdsql.jdbc.FBBlobField.getBinaryStream(FBBlobField.java:107)
at org.firebirdsql.jdbc.FBResultSet.getBinaryStream(FBResultSet.java:491)
at
hu.scriptum.codexml.rdbms.RdbmsBinary.readFromDatabase(RdbmsBinary.java:233)
at hu.scriptum.codexml.rdbms.RdbmsBinary.<init>(RdbmsBinary.java:99)
at hu.scriptum.codexml.rdbms.RdbmsXml.<init>(RdbmsXml.java:66)
at
hu.scriptum.codexml.rdbms.RdbmsTransaction.retrieve(RdbmsTransaction.java:52
4)
at
hu.scriptum.codexml.rdbms.AbstractObjectSet$1.readObject(AbstractObjectSet.j
ava:117)
at
hu.scriptum.codexml.rdbms.ResultSetIterator.moveToNextObject(ResultSetIterat
or.java:51)
at
hu.scriptum.codexml.rdbms.ResultSetIterator.next(ResultSetIterator.java:105)
at
hu.scriptum.codexml.test.ComplexQueryTest.testIterator(ComplexQueryTest.java
:444)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39
)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl
.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at junit.framework.TestCase.runTest(TestCase.java:166)
at junit.framework.TestCase.runBare(TestCase.java:140)
at junit.framework.TestResult$1.protect(TestResult.java:106)
at junit.framework.TestResult.runProtected(TestResult.java:124)
at junit.framework.TestResult.run(TestResult.java:109)
at junit.framework.TestCase.run(TestCase.java:131)
at junit.framework.TestSuite.runTest(TestSuite.java:173)
at junit.framework.TestSuite.run(TestSuite.java:168)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRu
nner.java:392)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.
java:276)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner
.java:167)
I suspect it is a bug in JayBird (1.0.1), because the next works and other
field can be read.
Do you have any workaround or fix available?
Thanks in advance,
Gabor
I am reading the rows from a ResultSet. During this iteration I have to
commit the transaction (because many database writes occure inside the
loop). I can continue to call next() on the same ResultSet, I can even get
"normal" fields (e.g. strings) from it, but when I call getBinaryStream on
it I get the following exception:
org.firebirdsql.jdbc.FBSQLException: GDS Exception. invalid transaction
handle (expecting explicit transaction start)
at org.firebirdsql.jdbc.FBBlob$FBBlobInputStream.<init>(FBBlob.java:359)
at org.firebirdsql.jdbc.FBBlob$FBBlobInputStream.<init>(FBBlob.java:348)
at org.firebirdsql.jdbc.FBBlob.getBinaryStream(FBBlob.java:168)
at org.firebirdsql.jdbc.FBBlobField.getBinaryStream(FBBlobField.java:107)
at org.firebirdsql.jdbc.FBResultSet.getBinaryStream(FBResultSet.java:491)
at
hu.scriptum.codexml.rdbms.RdbmsBinary.readFromDatabase(RdbmsBinary.java:233)
at hu.scriptum.codexml.rdbms.RdbmsBinary.<init>(RdbmsBinary.java:99)
at hu.scriptum.codexml.rdbms.RdbmsXml.<init>(RdbmsXml.java:66)
at
hu.scriptum.codexml.rdbms.RdbmsTransaction.retrieve(RdbmsTransaction.java:52
4)
at
hu.scriptum.codexml.rdbms.AbstractObjectSet$1.readObject(AbstractObjectSet.j
ava:117)
at
hu.scriptum.codexml.rdbms.ResultSetIterator.moveToNextObject(ResultSetIterat
or.java:51)
at
hu.scriptum.codexml.rdbms.ResultSetIterator.next(ResultSetIterator.java:105)
at
hu.scriptum.codexml.test.ComplexQueryTest.testIterator(ComplexQueryTest.java
:444)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39
)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl
.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at junit.framework.TestCase.runTest(TestCase.java:166)
at junit.framework.TestCase.runBare(TestCase.java:140)
at junit.framework.TestResult$1.protect(TestResult.java:106)
at junit.framework.TestResult.runProtected(TestResult.java:124)
at junit.framework.TestResult.run(TestResult.java:109)
at junit.framework.TestCase.run(TestCase.java:131)
at junit.framework.TestSuite.runTest(TestSuite.java:173)
at junit.framework.TestSuite.run(TestSuite.java:168)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRu
nner.java:392)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.
java:276)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner
.java:167)
at
org.firebirdsql.gds.GDSException: invalid transaction handle (expecting
explicit transaction start)
at org.firebirdsql.jgds.GDS_Impl.openOrCreateBlob(GDS_Impl.java:1340)
at org.firebirdsql.jgds.GDS_Impl.isc_open_blob2(GDS_Impl.java:1323)
at
org.firebirdsql.jca.FBManagedConnection.openBlobHandle(FBManagedConnection.j
ava:867)
at org.firebirdsql.jdbc.FBConnection.openBlobHandle(FBConnection.java:1155)
at org.firebirdsql.jdbc.FBBlob$FBBlobInputStream.<init>(FBBlob.java:356)
at org.firebirdsql.jdbc.FBBlob$FBBlobInputStream.<init>(FBBlob.java:348)
at org.firebirdsql.jdbc.FBBlob.getBinaryStream(FBBlob.java:168)
at org.firebirdsql.jdbc.FBBlobField.getBinaryStream(FBBlobField.java:107)
at org.firebirdsql.jdbc.FBResultSet.getBinaryStream(FBResultSet.java:491)
at
hu.scriptum.codexml.rdbms.RdbmsBinary.readFromDatabase(RdbmsBinary.java:233)
at hu.scriptum.codexml.rdbms.RdbmsBinary.<init>(RdbmsBinary.java:99)
at hu.scriptum.codexml.rdbms.RdbmsXml.<init>(RdbmsXml.java:66)
at
hu.scriptum.codexml.rdbms.RdbmsTransaction.retrieve(RdbmsTransaction.java:52
4)
at
hu.scriptum.codexml.rdbms.AbstractObjectSet$1.readObject(AbstractObjectSet.j
ava:117)
at
hu.scriptum.codexml.rdbms.ResultSetIterator.moveToNextObject(ResultSetIterat
or.java:51)
at
hu.scriptum.codexml.rdbms.ResultSetIterator.next(ResultSetIterator.java:105)
at
hu.scriptum.codexml.test.ComplexQueryTest.testIterator(ComplexQueryTest.java
:444)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39
)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl
.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at junit.framework.TestCase.runTest(TestCase.java:166)
at junit.framework.TestCase.runBare(TestCase.java:140)
at junit.framework.TestResult$1.protect(TestResult.java:106)
at junit.framework.TestResult.runProtected(TestResult.java:124)
at junit.framework.TestResult.run(TestResult.java:109)
at junit.framework.TestCase.run(TestCase.java:131)
at junit.framework.TestSuite.runTest(TestSuite.java:173)
at junit.framework.TestSuite.run(TestSuite.java:168)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRu
nner.java:392)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.
java:276)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner
.java:167)
I suspect it is a bug in JayBird (1.0.1), because the next works and other
field can be read.
Do you have any workaround or fix available?
Thanks in advance,
Gabor