Win a copy of TDD for a Shopping Website LiveProject this week in the Testing forum!
  • 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
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Frits Walraven
Bartenders:
  • Piet Souris
  • Himai Minh

Connection Pooling

 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Is it possible to implement connection pooling in WebSphere without Java code? An application that I'm about to inherit performs a getConnection to the database in 23 different JSPs, and will be accessible to several hundred users. When I asked the developer to consider connection pooling, he showed me on the WebSphere Administration Console that they had set Max Connections to 25 on the ServletEngine (and therefore that connection pooling was in place). He's the pro, but I have my doubts that he's right on this one.
 
author
Posts: 3892
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Mike Muschal:
Is it possible to implement connection pooling in WebSphere without Java code? An application that I'm about to inherit performs a getConnection to the database in 23 different JSPs, and will be accessible to several hundred users. When I asked the developer to consider connection pooling, he showed me on the WebSphere Administration Console that they had set Max Connections to 25 on the ServletEngine (and therefore that connection pooling was in place). He's the pro, but I have my doubts that he's right on this one.


If he really and truly believes that all you have to do to get connection pooling in WebSphere is to set the connections size in the admin console, he's not a pro, he's a dunce (and a dangerous one at that). However, my guess is that this is not what he meant.
WebSphere connection pooling (at least in WAS 3.5 and 4.0) is based around the DataSource class. To use WebSphere connection pooling you have to first look up a DataSource from a JNDI InitialContext, and then send "getConnection()" to the DataSource to get the connection.
The alternative is to use the javax.sql.DriverManager class to obtain your connections directly from the JDBC driver -- this does NOT use connection pooling and should NEVER be done in WebSphere (unless you are, perhaps, using a database not supported by the WebSphere connection pooling implementation).
Kyle
[ September 18, 2002: Message edited by: Kyle Brown ]
 
Ranch Hand
Posts: 58
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Technically, he does not have to write code for connection pooling itself. The driver providers/websphere write this code for us. All we need to do is to set it up. As Kyle points out though, the rest of the code (the developer's code) simply has to obtain this provided datasource implementation via JNDI and use the DataSource which encapsulates the connection pool.
I am assuming that they did setup the Datasource in WAS.
-t
 
Mike Muschal
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
My thanks to both of the responders. The code was in fact missing to use connection pooling. The developer thought that setting up the DataSource was the extent of using it. He did a little searching after my inquiry and found that more work was needed.
I appreciate this site a whole bunch. You guys are very helpful. I hope I can start answering questions soon myself.
 
expectation is the root of all heartache - shakespeare. tiny ad:
Free, earth friendly heat - from the CodeRanch trailboss
https://www.kickstarter.com/projects/paulwheaton/free-heat
reply
    Bookmark Topic Watch Topic
  • New Topic