org.h2.jdbc.JdbcSQLException: The object is already closed [90007-100]

3,990 views
Skip to first unread message

Cédric

unread,
Oct 29, 2008, 9:21:33 AM10/29/08
to H2 Database
I've got the following exception when using H2:

org.h2.jdbc.JdbcSQLException: The object is already closed [90007-100]
at org.h2.message.Message.getSQLException(Message.java:103)
at org.h2.message.Message.getSQLException(Message.java:114)
at org.h2.message.Message.getSQLException(Message.java:77)
at org.h2.message.Message.getSQLException(Message.java:149)
at org.h2.util.SmallMap.getObject(SmallMap.java:90)
at org.h2.server.TcpServerThread.process(TcpServerThread.java:
330)
at org.h2.server.TcpServerThread.run(TcpServerThread.java:127)
at java.lang.Thread.run(Thread.java:619)

at org.h2.engine.SessionRemote.done(SessionRemote.java:493)
at org.h2.command.CommandRemote.prepare(CommandRemote.java:70)
at org.h2.command.CommandRemote.<init>(CommandRemote.java:48)
at
org.h2.engine.SessionRemote.prepareCommand(SessionRemote.java:397)
at
org.h2.jdbc.JdbcConnection.prepareCommand(JdbcConnection.java:1035)
at
org.h2.jdbc.JdbcPreparedStatement.<init>(JdbcPreparedStatement.java:7
2)
at
org.h2.jdbc.JdbcConnection.prepareStatement(JdbcConnection.java:212)

I have no idea about which object is supposed to be closed. The
function where it happens is pretty big but there's nothing special in
it: it does a SELECT request and execute a lot of small SELECT request
inside a while loop on the result set, it is like this:

PreparedStatement pstmt = connection.prepareStatement(........);
...
ResultSet rs = pstmt.executeQuery();
while(rs)
{
a lot of small request generated from rs content
}


Thomas Mueller

unread,
Oct 31, 2008, 11:35:36 AM10/31/08
to h2-da...@googlegroups.com
Hi,

> PreparedStatement pstmt = connection.prepareStatement(........);
> ...
> ResultSet rs = pstmt.executeQuery();
> while(rs)
> {
> a lot of small request generated from rs content
> }

Most likely the problem is that the result set is closed while
processing the nested requests. Currently H2 uses a list of 64 open
JDBC objects per session. Theoretically H2 could use garbage
collection, but that's slow and not reliable. You can change the limit
using the system property h2.serverCachedObjects - see also
http://www.h2database.com/javadoc/org/h2/constant/SysProperties.html#h2.serverCachedObjects

You can set the limit higher. This shouldn't be a problem unless you
use many connections.

Please tell me if this doesn't solve the problem.

Regards,
Thomas

priyanka

unread,
Oct 20, 2012, 3:19:37 AM10/20/12
to h2-da...@googlegroups.com
hello sir,

Iam using my localhost connection only then also iam getting the exception as object already closed

This is my url

jdbc:h2:tcp://localhost/~/abc;mvcc=true

this is the exception iam getting

 2012-10-20 12:41:22,990 [c-14] DEBUG RPCManager - non-DMI response, dropExtraFields: false
=== 2012-10-20 12:41:23,005 [c-14] ERROR JSTranslater - Error converting Clob
org.h2.jdbc.JdbcSQLException: The object is already closed [90007-169]

Thanks in advance...

Thomas Mueller

unread,
Oct 23, 2012, 1:10:00 PM10/23/12
to h2-da...@googlegroups.com
Hi,

In the future, please don't re-use old email threads. Please create a new thread.

I guess the JDBC object is already closed. If it's not, could you post a simple, standalone, reproducible test case?

Regards,
Thomas


--
You received this message because you are subscribed to the Google Groups "H2 Database" group.
To view this discussion on the web visit https://groups.google.com/d/msg/h2-database/-/_3rIC6aaacEJ.
To post to this group, send email to h2-da...@googlegroups.com.
To unsubscribe from this group, send email to h2-database...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/h2-database?hl=en.

Reply all
Reply to author
Forward
0 new messages