Subject Re: Problems Firebird jdbc
Author aalliana
Hello Olaf,

This post should probably go to the firebird-java group.

Nevertheless, I had a similar problem when using several statements on the same connection object or several result sets on the same statement object.

Without further information, I would suggest that you create your statements using the following constuctor:

createStatement(int resultSetType, int resultSetConcurrency, int resultSetHoldability)

or

prepareStatement(String sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability)


and set the last parameter to:

ResultSet.HOLD_CURSORS_OVER_COMMIT


--- In firebird-support@yahoogroups.com, "Olaf Kluge" <olaf.kluge@...> wrote:
>
> Hello dear firebird experts,
>
> for some days, we had a problem with our firebird-java connection.
> Firebird.log and the database-server-Event History does not report any
> problems.
>
> But the Java-Application brings the follow error messages:
>
> 2010-03-30 23:34:36,984 INFO Insert:168 - insert HALLE: FGNR: 124 Target:
> PID: FBID:
>
> 2010-03-30 23:34:40,328 ERROR Select:3030 - Fehler bei der Abfrage von
> Auftrgasdaten
>
> org.firebirdsql.jdbc.FBSQLException: Result set is already closed.
>
> at
> org.firebirdsql.jdbc.FBStatementFetcher.checkClosed(FBStatementFetcher.java:
> 232)
>
> at
> org.firebirdsql.jdbc.FBStatementFetcher.fetch(FBStatementFetcher.java:187)
>
> at org.firebirdsql.jdbc.FBStatementFetcher.next(FBStatementFetcher.java:119)
>
> at org.firebirdsql.jdbc.AbstractResultSet.next(AbstractResultSet.java:250)
>
> at com.carnet.DB.LVSDBData.Select.get_Auftragsdaten(Select.java:3021)
>
> at Main.TTaskRBGAA.run(TTaskRBGAA.java:68)
>
> at java.util.TimerThread.mainLoop(Unknown Source)
>
> at java.util.TimerThread.run(Unknown Source)
>
> 2010-03-30 23:42:10,796 INFO Insert:168 - insert HALLE: FGNR: 400 Target:
> PID: FBID:
>
> 2010-03-30 23:42:11,109 ERROR Select:3030 - Fehler bei der Abfrage von
> Auftrgasdaten
>
> org.firebirdsql.jdbc.FBSQLException: The resultSet is closed
>
> at
> org.firebirdsql.jdbc.AbstractResultSet.getField(AbstractResultSet.java:616)
>
> at
> org.firebirdsql.jdbc.AbstractResultSet.getField(AbstractResultSet.java:599)
>
> at
> org.firebirdsql.jdbc.AbstractResultSet.getString(AbstractResultSet.java:547)
>
> at com.carnet.DB.LVSDBData.Select.get_Auftragsdaten(Select.java:3025)
>
> at Main.TTaskRBGAA.run(TTaskRBGAA.java:68)
>
> at java.util.TimerThread.mainLoop(Unknown Source)
>
> at java.util.TimerThread.run(Unknown Source)
>
> 2010-04-01 01:58:26,671 ERROR Select:920 - SQL-Fehler beim Suchen nach
> optimalen Platz aufgetreten:
>
> org.firebirdsql.jdbc.FBSQLException: GDS Exception. 335544569. Dynamic SQL
> Error
>
> SQL error code = -504
>
> Invalid cursor reference
>
> Cursor is not open
>
> at
> org.firebirdsql.jdbc.FBStatementFetcher.fetch(FBStatementFetcher.java:206)
>
> at org.firebirdsql.jdbc.FBStatementFetcher.next(FBStatementFetcher.java:137)
>
> at org.firebirdsql.jdbc.AbstractResultSet.next(AbstractResultSet.java:250)
>
> at com.carnet.DB.LVSDBData.Select.selectOptPlace2(Select.java:868)
>
> at Main.LVS.findOptPlace(LVS.java:178)
>
> at Main.LVS.generateFDRBG_RQ(LVS.java:789)
>
> at Main.LVS.einlagernPlatz(LVS.java:1493)
>
> at Main.LVS.analyzeXE(LVS.java:1132)
>
> at ConnectionSPS.SPSrecieve.checkTelegramm(SPSrecieve.java:400)
>
> at ConnectionSPS.SPSrecieve.run(SPSrecieve.java:130)
>
> at java.lang.Thread.run(Unknown Source)
>
> at
>
> org.firebirdsql.gds.GDSException: Dynamic SQL Error
>
> SQL error code = -504
>
> Invalid cursor reference
>
> Cursor is not open
>
> at
> org.firebirdsql.gds.impl.wire.AbstractJavaGDSImpl.readStatusVector(AbstractJ
> avaGDSImpl.java:2124)
>
> at
> org.firebirdsql.gds.impl.wire.AbstractJavaGDSImpl.receiveResponse(AbstractJa
> vaGDSImpl.java:2074)
>
> at
> org.firebirdsql.gds.impl.wire.AbstractJavaGDSImpl.iscDsqlFetch(AbstractJavaG
> DSImpl.java:1333)
>
> at org.firebirdsql.gds.impl.GDSHelper.fetch(GDSHelper.java:264)
>
> at
> org.firebirdsql.jdbc.FBStatementFetcher.fetch(FBStatementFetcher.java:201)
>
> at org.firebirdsql.jdbc.FBStatementFetcher.next(FBStatementFetcher.java:137)
>
> at org.firebirdsql.jdbc.AbstractResultSet.next(AbstractResultSet.java:250)
>
> at com.carnet.DB.LVSDBData.Select.selectOptPlace2(Select.java:868)
>
> at Main.LVS.findOptPlace(LVS.java:178)
>
> at Main.LVS.generateFDRBG_RQ(LVS.java:789)
>
> at Main.LVS.einlagernPlatz(LVS.java:1493)
>
> at Main.LVS.analyzeXE(LVS.java:1132)
>
> at ConnectionSPS.SPSrecieve.checkTelegramm(SPSrecieve.java:400)
>
> at ConnectionSPS.SPSrecieve.run(SPSrecieve.java:130)
>
> at java.lang.Thread.run(Unknown Source)
>
>
>
> Can you help me please, what was not ok at this time.
>
> After we restart the Application, it works fine again.
>
> We don't have problems with transactions, the gstat-result ist very well.
>
> Thanks for helping.
>
>
> Best regards
>
> Olaf
>