Subject Hang using Firebird JCA driver
Author aiylam_s
Hi,
I am using the Firebird 1.5.5 JDBC driver in a environment that
consists of the Spring framework, Hibernate and XAPool/JOTM. From
time to time (quite intermittently), I see the driver hang with the
call stack shown below. The hang seems to be during a call to
socket.read(). When this call is hung, I can access the database fine
using isql or the org.firebirdsql.jdbc.FBDriver directly - I can read
and write to the database using these.
Any ideas on why this happens? Is it to do with two-phase commits?
Any pointers will be greatly appreciated.
Thanks,
S.Aiylam

P.S.: By the way, all this happens inside Tomcat.

- java.net.SocketInputStream.socketRead0(java.io.FileDescriptor, byte
[], int, int, int) (Compiled frame; information may be imprecise)
- java.net.SocketInputStream.read(byte[], int, int) @bci=84,
line=129 (Compiled frame)
- org.firebirdsql.gds.XdrInputStream.readInt() @bci=1, line=121
(Compiled frame)
- org.firebirdsql.jgds.GDS_Impl.isc_dsql_execute2
(org.firebirdsql.gds.isc_tr_handle,
org.firebirdsql.gds.isc_stmt_handle, int, org.firebirdsql.gds.XSQLDA,
org.firebirdsql.gds.XSQLDA) @bci=216, line=904 (Interpreted frame)
- org.firebirdsql.jca.FBManagedConnection.executeStatement
(org.firebirdsql.gds.isc_stmt_handle, boolean) @bci=33, line=793
(Interpreted frame)
- org.firebirdsql.jdbc.AbstractConnection.executeStatement
(org.firebirdsql.gds.isc_stmt_handle, boolean) @bci=33, line=946
(Interpreted frame)
- org.firebirdsql.jdbc.AbstractPreparedStatement.internalExecute
(boolean) @bci=135, line=499 (Interpreted frame)
- org.firebirdsql.jdbc.AbstractPreparedStatement.executeUpdate()
@bci=21, line=144 (Interpreted frame)
- org.enhydra.jdbc.core.CorePreparedStatement.executeUpdate()
@bci=4, line=102 (Interpreted frame)
- org.hibernate.jdbc.NonBatchingBatcher.addToBatch(int) @bci=4,
line=22 (Interpreted frame)
- org.hibernate.persister.entity.BasicEntityPersister.update
(java.io.Serializable, java.lang.Object[], java.lang.Object[],
java.lang.Object, boolean[], int, java.lang.Object, java.lang.Object,
java.lang.String, org.hibernate.engine.SessionImplementor) @bci=420,
line=1982 (Interpreted frame)
- org.hibernate.persister.entity.BasicEntityPersister.updateOrInsert
(java.io.Serializable, java.lang.Object[], java.lang.Object[],
java.lang.Object, boolean[], int, java.lang.Object, java.lang.Object,
java.lang.String, org.hibernate.engine.SessionImplementor) @bci=101,
line=1909 (Interpreted frame)
- org.hibernate.persister.entity.BasicEntityPersister.update
(java.io.Serializable, java.lang.Object[], int[], boolean,
java.lang.Object[], java.lang.Object, java.lang.Object,
java.lang.Object, org.hibernate.engine.SessionImplementor) @bci=199,
line=2149 (Interpreted frame)
- org.hibernate.action.EntityUpdateAction.execute() @bci=176,
line=75 (Interpreted frame)
- org.hibernate.engine.ActionQueue.execute
(org.hibernate.action.Executable) @bci=68, line=239 (Interpreted
frame)
- org.hibernate.engine.ActionQueue.executeActions(java.util.List)
@bci=25, line=223 (Interpreted frame)
- org.hibernate.engine.ActionQueue.executeActions() @bci=13,
line=137 (Interpreted frame)
-
org.hibernate.event.def.AbstractFlushingEventListener.performExecution
s(org.hibernate.engine.SessionImplementor) @bci=25, line=274
(Interpreted frame)
- org.hibernate.event.def.DefaultFlushEventListener.onFlush
(org.hibernate.event.FlushEvent) @bci=24, line=27 (Interpreted frame)
- org.hibernate.impl.SessionImpl.flush() @bci=35, line=730
(Interpreted frame)
-
org.springframework.orm.hibernate3.SessionFactoryUtils$SpringSessionSy
nchronization.beforeCommit(boolean) @bci=63, line=875 (Interpreted
frame)
-
org.springframework.transaction.support.AbstractPlatformTransactionMan
ager.triggerBeforeCommit
(org.springframework.transaction.support.DefaultTransactionStatus)
@bci=51, line=594 (Interpreted frame)
-
org.springframework.transaction.support.AbstractPlatformTransactionMan
ager.processCommit
(org.springframework.transaction.support.DefaultTransactionStatus)
@bci=4, line=434 (Interpreted frame)
-
org.springframework.transaction.support.AbstractPlatformTransactionMan
ager.commit(org.springframework.transaction.TransactionStatus)
@bci=102, line=421 (Interpreted frame)
- com.exagrid.dirsvcs.persistence.PersistentApiManagerImpl.commitTx
(org.springframework.transaction.TransactionStatus) @bci=5, line=1412
(Interpreted frame)
-
com.exagrid.dirsvcs.persistence.PersistentApiManagerImpl.updateGridRes
ource(com.exagrid.common.GridResource) @bci=30, line=843 (Interpreted
frame)

........