• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Connection pool issue

 
Ranch Hand
Posts: 62
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have a scenario. I am using the websphere for obtaining the connection from pool.

The connection pool is of non transactional it has min = 10 max= 20 . The problem I am facing is in the code the connection is getting closed but for some reason IBM holds on to the closed connection and not reusing it in the pool. I can see through tivolli monitor that it almost opened 150 connection and closed all 150 and there are 2-4 in the pool.

But when I talk to the DBA he is saying that all the 150 opened connections are inactive but hold on by the Websphere.

I am sending the codes here, any help will be appreciated. I am using Hibernate.


Connection factory class





DBUtil class which is used by the codes to open and close the transaction.




Hibernate config settings.





A typical implementation.


query = getDbutil().startNewTransaction("GET_MATERIAL_ID_FOR_MATERIAL_CODE");
query.setString(0, material);
list = getDbutil1().executeQueryCommit(query);





 
Bartender
Posts: 1357
39
IBM DB2 Netbeans IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi, which database are you connecting to ? And about connections: these are "returned" to the pool, or simply closed ? The first behavior is absolutely normal; for "closed" connections, I usually see connection closed in TPV but I'm quite sure that, despite of min and max connection pool settings, WAS may decide to close an "older" or "unused" connection, but I'd like to do more investigation about this.

 
Arun Kumar
Ranch Hand
Posts: 62
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Claude, Thanks for your response but it seems like there is some compatibility issue.

Instead of using the connection pool setting of websphere I plugged it in to the built in connection pool setting of Hibernate.




This works perfectly fine as expected. When observing through TPM, what I saw is on close of the connection it actually does not close the connection and websphere latches on to the old connection.


E J2CA0081E: Method cleanup failed while trying to execute method cleanup on ManagedConnection WSRdbManagedConnectionImpl@45c245c2 from resource jdbc/defaultDS. Caught exception: com.ibm.ws.exception.WsException: DSRA0080E: An exception was received by the Data Store Adapter. See original exception message: Cannot call 'cleanup' on a ManagedConnection while it is still in a transaction.


 
reply
    Bookmark Topic Watch Topic
  • New Topic