-
Bug
-
Resolution: Duplicate
-
Major
-
fuse-esb-7.1.0
-
None
-
None
-
%
If bundle exports a service which implements javax.sql.XADataSource, then Fuse ESB, according to auto-enlistment feature [1], is supposed to pick up this service
and re-export a proxy data source service implementing javax.sql.DataSource interface. This new proxy service is responsible for auto-enlistment of XA connections
into global transaction context. Applications should obtain connections from javax.sql.DataSource service. Then, upon connection closure and transaction completion, the proxy should return connection back to the pool. Unfortunately, it does not happen so connection pool is exhausted after some time.
Reproducer is attached:
1.) Service method which inserts one row into one-column table
2.) Method is called in the transaction context which is confgigured in blueprint.xml by <tx:transaction> element
3.) Connections are taken from pool of max size=20 (Tomcat XA pool is used), DB underneath is Oracle
4.) Service method is called from client bundle 21 times
5.) The last service call stucks and then exception is thrown
Caused by: org.apache.tomcat.jdbc.pool.PoolExhaustedException: [pool-org.sample.osgi-test-client-0.0.1.SNAPSHOT-thread-1] Timeout: Pool empty. Unable to fetch a connection in 30 seconds, none available[size:20; busy:20; idle:0; lastwait:30000].
at org.apache.tomcat.jdbc.pool.ConnectionPool.borrowConnection(ConnectionPool.java:672)
at org.apache.tomcat.jdbc.pool.ConnectionPool.getConnection(ConnectionPool.java:187)
at org.apache.tomcat.jdbc.pool.DataSourceProxy.getConnection(DataSourceProxy.java:128)
at org.apache.tomcat.jdbc.pool.DataSourceProxy.getXAConnection(DataSourceProxy.java:146)
at org.apache.aries.transaction.jdbc.internal.XADatasourceEnlistingWrapper.getConnection(XADatasourceEnlistingWrapper.java:67)
at org.sample.osgi.test.server.TestOSGIServiceImpl.sayHello2(TestOSGIServiceImpl.java:104)
Note: Problem cannot be attributed to the parcticular pool implementatio being used. If, instead of Tomcat pool, we would use e.g. oracle.jdbc.xa.client.OracleXADataSource, the problem still stands.
- is related to
-
ENTESB-633 auto-enlisting JDBC drivers in Aries transaction manager is broken
- Closed