Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Connection Pool Configurations

145 views
Skip to first unread message

bandisi...@gmail.com

unread,
Feb 8, 2009, 1:30:04 AM2/8/09
to
Hi All,
We are using the WAS 6.1 app server(Cluster environment) and oracle database(10g).
In the connection pool configuration we gave Minimum No of connection as 2 and Maximun No of connections as 30 with Connection time out parameter as 180. The problem is the connectivity between the appserver and the DB is getting disconnected some times and we are getting the following exception in the SystemErrlog.

[2/7/09 22:08:33:877 GST] 0000003a SystemErr R org.hibernate.exception.GenericJDBCException: Cannot open connection
at org.hibernate.exception.SQLStateConverter.handledNonSpecificException(SQLStateConverter.java:103)
at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:91)
at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)
at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:29)
at org.hibernate.jdbc.ConnectionManager.openConnection(ConnectionManager.java:420)
at org.hibernate.jdbc.ConnectionManager.getConnection(ConnectionManager.java:144)
at org.hibernate.jdbc.AbstractBatcher.prepareQueryStatement(AbstractBatcher.java:105)
at org.hibernate.loader.Loader.prepareQueryStatement(Loader.java:1561)
at org.hibernate.loader.hql.QueryLoader.iterate(QueryLoader.java:392)
at org.hibernate.hql.ast.QueryTranslatorImpl.iterate(QueryTranslatorImpl.java:318)
at org.hibernate.engine.query.HQLQueryPlan.performIterate(HQLQueryPlan.java:177)
at org.hibernate.impl.SessionImpl.iterate(SessionImpl.java:1156)
at org.hibernate.impl.QueryImpl.iterate(QueryImpl.java:46)
Caused by: com.ibm.websphere.ce.cm.StaleConnectionException: Io exception: The Network Adapter could not establish the connectionDSRA0010E: SQL State = null, Error Code = 17,002
at sun.reflect.GeneratedConstructorAccessor136.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:522)
at com.ibm.websphere.rsadapter.GenericDataStoreHelper.mapExceptionHelper(GenericDataStoreHelper.java:523)
at com.ibm.websphere.rsadapter.GenericDataStoreHelper.mapException(GenericDataStoreHelper.java:578)
at com.ibm.ws.rsadapter.AdapterUtil.mapException(AdapterUtil.java:2041)
at com.ibm.ws.rsadapter.spi.WSRdbDataSource.getPooledConnection(WSRdbDataSource.java:1189)
at com.ibm.ws.rsadapter.spi.WSManagedConnectionFactoryImpl.createManagedConnection(WSManagedConnectionFactoryImpl.java:1055)
at com.ibm.ejs.j2c.FreePool.createManagedConnectionWithMCWrapper(FreePool.java:1811)
at com.ibm.ejs.j2c.FreePool.createOrWaitForConnection(FreePool.java:1543)
at com.ibm.ejs.j2c.PoolManager.reserve(PoolManager.java:2215)
at com.ibm.ejs.j2c.ConnectionManager.allocateMCWrapper(ConnectionManager.java:896)
at com.ibm.ejs.j2c.ConnectionManager.allocateConnection(ConnectionManager.java:596)
at com.ibm.ws.rsadapter.jdbc.WSJdbcDataSource.getConnection(WSJdbcDataSource.java:431)
at com.ibm.ws.rsadapter.jdbc.WSJdbcDataSource.getConnection(WSJdbcDataSource.java:400)
at org.hibernate.connection.DatasourceConnectionProvider.getConnection(DatasourceConnectionProvider.java:69)
at org.hibernate.jdbc.ConnectionManager.openConnection(ConnectionManager.java:417)
... 42 more

Can any one tell me how to resolve this error.

Thanks & Regards,
Cva.

rswar...@kc.rr.com

unread,
Feb 8, 2009, 11:09:12 AM2/8/09
to
On Feb 8, 12:30 am, bandisivaku...@gmail.com wrote:
> Hi All,
>   We are using the WAS 6.1 app server(Cluster environment) and oracle database(10g).
>  In the connection pool configuration we gave Minimum No of connection as 2 and Maximun No of connections as 30 with  Connection time out parameter as 180. The problem is the connectivity between the appserver and the DB is getting disconnected some times and we are getting the following exception in the SystemErrlog.
>
> [2/7/09 22:08:33:877 GST] 0000003a SystemErr     R org.hibernate.exception.GenericJDBCException: Cannot open connection
>         at org.hibernate.exception.SQLStateConverter.handledNonSpecificException(SQLSt­ateConverter.java:103)
>         at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:91­)
>         at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.jav­a:43)
>         at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.jav­a:29)
>         at org.hibernate.jdbc.ConnectionManager.openConnection(ConnectionManager.java:­420)
>         at org.hibernate.jdbc.ConnectionManager.getConnection(ConnectionManager.java:1­44)
>         at org.hibernate.jdbc.AbstractBatcher.prepareQueryStatement(AbstractBatcher.ja­va:105)

>         at org.hibernate.loader.Loader.prepareQueryStatement(Loader.java:1561)
>         at org.hibernate.loader.hql.QueryLoader.iterate(QueryLoader.java:392)
>         at org.hibernate.hql.ast.QueryTranslatorImpl.iterate(QueryTranslatorImpl.java:­318)
>         at org.hibernate.engine.query.HQLQueryPlan.performIterate(HQLQueryPlan.java:17­7)

>         at org.hibernate.impl.SessionImpl.iterate(SessionImpl.java:1156)
>         at org.hibernate.impl.QueryImpl.iterate(QueryImpl.java:46)
> Caused by: com.ibm.websphere.ce.cm.StaleConnectionException: Io exception: The Network Adapter could not establish the connectionDSRA0010E: SQL State = null, Error Code = 17,002
>         at sun.reflect.GeneratedConstructorAccessor136.newInstance(Unknown Source)
>         at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstru­ctorAccessorImpl.java:45)
>         at java.lang.reflect.Constructor.newInstance(Constructor.java:522)
>         at com.ibm.websphere.rsadapter.GenericDataStoreHelper.mapExceptionHelper(Gener­icDataStoreHelper.java:523)
>         at com.ibm.websphere.rsadapter.GenericDataStoreHelper.mapException(GenericData­StoreHelper.java:578)
>         at com.ibm.ws.rsadapter.AdapterUtil.mapException(AdapterUtil.java:2041)
>         at com.ibm.ws.rsadapter.spi.WSRdbDataSource.getPooledConnection(WSRdbDataSourc­e.java:1189)
>         at com.ibm.ws.rsadapter.spi.WSManagedConnectionFactoryImpl.createManagedConnec­tion(WSManagedConnectionFactoryImpl.java:1055)

>         at com.ibm.ejs.j2c.FreePool.createManagedConnectionWithMCWrapper(FreePool.java­:1811)
>         at com.ibm.ejs.j2c.FreePool.createOrWaitForConnection(FreePool.java:1543)
>         at com.ibm.ejs.j2c.PoolManager.reserve(PoolManager.java:2215)
>         at com.ibm.ejs.j2c.ConnectionManager.allocateMCWrapper(ConnectionManager.java:­896)
>         at com.ibm.ejs.j2c.ConnectionManager.allocateConnection(ConnectionManager.java­:596)
>         at com.ibm.ws.rsadapter.jdbc.WSJdbcDataSource.getConnection(WSJdbcDataSource.j­ava:431)
>         at com.ibm.ws.rsadapter.jdbc.WSJdbcDataSource.getConnection(WSJdbcDataSource.j­ava:400)
>         at org.hibernate.connection.DatasourceConnectionProvider.getConnection(Datasou­rceConnectionProvider.java:69)

>         at org.hibernate.jdbc.ConnectionManager.openConnection(ConnectionManager.java:­417)
>         ... 42 more
>
>  Can any one tell me how to resolve this error.
>
> Thanks & Regards,
> Cva.

If there is a firewall between the app server and the db server it may
be dropping the idle connections. If so, have the firewall configured
not to drop the conditions. You can also look at coding your
application to retry when it gets the StaleConnectionException or
setting the Connection Pool minimum connections to 0.

bronzedrum

unread,
Feb 9, 2009, 8:45:53 AM2/9/09
to
I agree that it seems like the root cause may be the network? But why
would connections be dropped? And WebSphere can successfully reconnect
to a datasource after losing its connection.

Questions:

1) Is the database refusing to connect because the number of
connection threads is maxed? Are connection threads leaking, or is the
J2EE application continuously creating additional connections and
holding on to them?
2) If you turn on the PMI metrics for WebSphere's datasource
connection pool, how many connections are in use? What is the
utilization or "busy time" for the pool?

Also, turn on the relevant WebSphere tracing so as to view detailed
information about the datasource and connection pooling events.

3) Is hibernate managing the connection pool, or is WebSphere? Is
there a conflict between the connection management/connection pool
created/managed by Hibernate, and between the connection pool managed
by WebSphere?
4) How does Hibernate "handle" a situation in which it loses its
connection to the datasource? Does it gracefully reconnect and purge
the "stale" connection objects in the pool?

5) What does the Database DBA "see" on the database side? How are the
database resources (threads, connections, connection timeouts)
impacted?
6) Do you see any application errors logged to the WebSphere stdout
logs or other logs?

More questions than answers. I would investigate these questions so as
to truly understand the dynamics of this issue.

Brian

bandisi...@gmail.com

unread,
Feb 25, 2009, 3:18:54 AM2/25/09
to
Hi Guys,
There are different scenarios which this exception will occurs.

This exception (com.ibm.websphere.ce.cm.StaleConnectionException) indicates that the connection currently being held is no longer valid. This can occur for numerous reasons,
including the following:
1 The application tries to get a connection and fails, as when the database is not started.
2 A connection is no longer usable due to a database failure. When an application tries to use a connection it has previously obtained, the connection is no longer valid. In this case, all connections currently in use by an application could get this error when they try to use the connection.
3 The application using the connection has already called close() and then tries to use the connection again.
4 The connection has been orphaned because the application had not used it in at most two times the orphan timeout; then the application tries to use the orphaned connection.
5 The application tries to use a JDBC resource, such as a statement, obtained on a now-stale connection.


The issue had been solved..there is some problem in the network connectivity between appserver and dbserver which has been solved by the network team......now i am not getting the error....

0 new messages