Dear Noel,
if the problem were so simple we wouldn't have spent time to write here.

We are talking about a piece of code that is iterating over a result set
and, from one iteration to the other, is failing because H2 says that "the
connection is closed", while of course our code isn't closing it in any way.
The code is single-threaded, so no other thread may interfere and close the
connection unexpectedly while the iteration is in progress.

In this use case H2 is used within an XA transactional infrastructure based
on Spring + JBoss Transactions + a custom ORM layer that is handling all the
JDBC operations and which has proven to be rock solid (as my co-woker Davide
says) during the last 7 years, where this code has been used in both
production and test environments using other DBMSes like PostgreSQL, Oracle
and SQL Server.

This is why the only idea that came to our mind is that there may be some H2
internal "transaction timeout" event that is closing the physical JDBC
connection while the result set iteration is still in progress, which is
something that in our own experience can happen in SQL Server if you don't
tune the Microsoft Transactional Coordinator component as needed. 
Our transactional infrastructure is currently leaving the default
transaction timeout on the XAResource, however even if we tried to force a
different transaction time out, looking at the H2 code it seems like
org.h2.jdbcx.JdbcXAConnection.setTransactionTimeout(int) (which implements
javax.transaction.xa.XAResource.setTransactionTimeout(int)) isn't actually
implemented.

This said, since our readings of H2 documentation lead to nowhere, we have
written here to see if some better ideas could give us some hints on how to
proceed at debugging this problem.

Mauro Molinari.



--
View this message in context: 
http://h2-database.66688.n3.nabble.com/JdbcXAConnection-and-transaction-timeout-The-object-is-already-closed-tp4026399p4026405.html
Sent from the H2 Database mailing list archive at Nabble.com.

-- 
You received this message because you are subscribed to the Google Groups "H2 
Database" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to h2-database+unsubscr...@googlegroups.com.
To post to this group, send email to h2-database@googlegroups.com.
Visit this group at http://groups.google.com/group/h2-database?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to