Atomikos Forum |
|
We've setup an xa datasource using Transaction-Essentials (3.5.8) under tomcat 5.5x. Everything works great.
But, they are putting a firewall betwen our app and the db, and the firewall automatically disconnects idle connections after a pre-configured amount of time. Any way to to configure the AtomikosDataSourceBean to test each connection on borrow so the app doesn't get dead connections closed by the firewall. I see there's a "testOnBorrow" attribute on NonXADataSourceBean, but not AtomikosDataSourceBean. For completeness, here's the tomcat datasouce configuration: <Resource name="pfmPool" auth="Container" type="com.atomikos.jdbc.AtomikosDataSourceBean" factory="com.atomikos.tomcat.BeanFactory" uniqueResourceName="myPool" xaDataSourceClassName="oracle.jdbc.xa.client.OracleXADataSource" xaProperties.URL="jdbc:oracle:thin:@10.160.43.46:1561:DBSID" maxPoolSize="40" minPoolSize="5" borrowConnectionTimeout="30" testQuery="select 1 from dual" xaProperties.user="the_user" xaProperties.password="the_pass"/> Thanks in advance.
Thanks for the reply. Yes, testQuery is already in the config (posted above).
I was looking for a way to configure the connection pool so that it would test each connection *before* it is handed to the application code. As mentioned above, connections in the pool are being disconnected by the firewall after a period of inactivity, so the connection pool is handing the application a dead connection. For now we've set the pool maxIdleTime to 30 seconds and minPoolSize to 0. Obviously this isn't optimal, but it gives us a better chance of not getting a connection from the pool that's already been closed by the firewall. |