This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to use connectionpooling for a datasource

 
Ben Klug
Ranch Hand
Posts: 45
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I have a datasource in WAS51 defined and I want to use the connection pooling. how do I have to write the code?

- get the inital context, the datasource and the connection each time required
- keep the context and get the datasource and the connction every time
- keep the datasource and get the connection everytime or
- keep the connection

what is the best way to do it? do I have to close the connection after each execution or is this managed by the server?

thanks
b
 
emm raha
Ranch Hand
Posts: 57
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What sort of application is this for? If its a web application, would you persist the context, datasource, or connection for multiple requests? The initial context is used for a lookup of the datasource. The datasource is a connection factory interface implemented by the vendor (IBM) to enable connection pooling, persisting that isn't useful either. And if you want to get a connection from the pool, why would you want to hang on to a connection? My understanding is very rudimentary, but I would suggest option 1 (feel free to correct me).
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic