commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Thomas Fischer" <Thomas.Fisc...@movielink.com>
Subject [dbcp] hanging on set autocommit - related to bug #30391
Date Fri, 01 Jul 2005 22:31:21 GMT
Hi,
We seem to experience the same symptoms as bug #30391 in production (not
reproducible with stress testing in QA environments).

Randomly, a server thread will get stuck. It's always the same stack
trace. Hibernate requests a db connection from dbcp. DBCP gets the
connection out of the pool, and executes 'set autocommit'. Rather then
throwing an error about a problem with the underlying Oracle connection,
it is hanging for 2-15 minutes on a socket.read().

The reported bug supposes that the database connection is bad. As dbcp
tries to execute set autocommit before testing the connection, dbcp
doesn't realize that the connection has gone bad. The bug reporter
suggested running a test query with setQueryTimeout.

For curiosity, I removed all set autocommit calls from dbcp source code,
recompiled the code, and put it on one production instance. Now the code
is not hanging anymore on dbcp set autocommit, but whatever hibernate
was trying to do with the connection.


Has that bug been followed up on? It's one year old, and I didn't find
anything related. Is this the problem that I might have? Does anyone
else have a similar problem?

I'm thinking of modifying the dbcp code to better capture this kind of
error. E.g., making the execution of set autocommit configurable (it's
configurable to what it is set to. Though, there is no config option to
disable it). Or switching the activation code with the testing of the
connection. Is there any advice, on what a good approach would be to
follow the dbcp philosophy, and potentially be accepted back into dbcp?



Thank you,
Thomas





Environment info: We are using Linux on ATG Dynamo 6.4.0 servers with
hibernate 2 to connect to Oracle 8i over the Oracle jdbc driver, and
current version of dbcp.


Here is the typical stack trace:
	at java.net.SocketInputStream.socketRead(Native Method)
	at java.net.SocketInputStream.read(SocketInputStream.java:85)
	at oracle.net.ns.Packet.receive(Unknown Source)
	at oracle.net.ns.NetInputStream.getNextPacket(Unknown Source)
	at oracle.net.ns.NetInputStream.read(Unknown Source)
	at oracle.net.ns.NetInputStream.read(Unknown Source)
	at oracle.net.ns.NetInputStream.read(Unknown Source)
	at oracle.jdbc.ttc7.MAREngine.unmarshalUB1(MAREngine.java:718)
	at oracle.jdbc.ttc7.MAREngine.unmarshalSB1(MAREngine.java:690)
	at oracle.jdbc.ttc7.Ocommoncall.receive(Ocommoncall.java:108)
	at
oracle.jdbc.ttc7.TTC7Protocol.setAutoCommit(TTC7Protocol.java:435)
	at
oracle.jdbc.driver.OracleConnection.setAutoCommit(OracleConnection.java:
799)
	at
org.apache.commons.dbcp.DelegatingConnection.setAutoCommit(DelegatingCon
nection.java:268)
	at
org.apache.commons.dbcp.PoolableConnectionFactory.activateObject(Poolabl
eConnectionFactory.java:368)
	at
org.apache.commons.pool.impl.GenericObjectPool.borrowObject(GenericObjec
tPool.java:787)
	at
org.apache.commons.dbcp.PoolingDataSource.getConnection(PoolingDataSourc
e.java:95)
	at
net.sf.hibernate.connection.DBCPConnectionProvider.getConnection(DBCPCon
nectionProvider.java:41)
	at
net.sf.hibernate.impl.BatcherImpl.openConnection(BatcherImpl.java:286)
	at
net.sf.hibernate.impl.SessionImpl.connect(SessionImpl.java:3326)
	at
net.sf.hibernate.impl.SessionImpl.connection(SessionImpl.java:3286)
	at
net.sf.hibernate.impl.BatcherImpl.prepareQueryStatement(BatcherImpl.java
:65)
	at
net.sf.hibernate.loader.Loader.prepareQueryStatement(Loader.java:779)
	at net.sf.hibernate.loader.Loader.doQuery(Loader.java:265)
	at
net.sf.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Lo
ader.java:133)
	at net.sf.hibernate.loader.Loader.doList(Loader.java:1033)
	at net.sf.hibernate.loader.Loader.list(Loader.java:1024)
	at
net.sf.hibernate.hql.QueryTranslator.list(QueryTranslator.java:854)
	at net.sf.hibernate.impl.SessionImpl.find(SessionImpl.java:1544)
	at net.sf.hibernate.impl.QueryImpl.list(QueryImpl.java:39)
	at
com.movielink.help.hibernate.MlHelpTopic.getRootTopics(MlHelpTopic.java:
263)


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message