File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JDBC and Relational Databases and the fly likes About connection pooling Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC and Relational Databases
Bookmark "About connection pooling" Watch "About connection pooling" New topic

About connection pooling

giang nguyen
Ranch Hand

Joined: May 13, 2003
Posts: 42
Does each connection in the pool corresponds to an Oracle user's session? It seems no. I've configured a pool of 50 connections in my datasource in WAS and run my web application which use the above DS to connect to Database but when I open the Oracle Enterprise manager console there's only one session for the user from the WAS machine.
BTW, when I killed that session in Oracle, my webapp can run without throwing SQLException. It seems the pool automatically create another session to Oracle to replace the killed one.
What do you think about this. It seems I do not have a good understanding of connection pooling. Hope you can explain.

Rudy Dakota
Ranch Hand

Joined: Jul 27, 2002
Posts: 54
Hi Giang,
Let me just speculate that 50 connections is the pool's maximum size. Normally it will open connections as they are needed, though there are also pools that open the minimum number of connections for starters. If you do not do a lot of database access, one open connection will easily suffice. Why would the pool open more? After all, its rationale is to limit the number of open connections.
This is of course all speculation, but grounded in a basic understanding of what the pool does. In order to give a detailed account, we 'd need to know what pool you are using and how exactly you configured it.
The pool establishing a new connection seems just expected behaviour to me: either it re-established the invalid connection you killed, or it opened a new one (from the pool's perspective, from a DB perspective it 's always a new connection). Good, that 's what the pool is there for.
Good riding,
Jeanne Boyarsky
author & internet detective

Joined: May 26, 2003
Posts: 33130

As Rudy pointed out, the connection is not tied to the user's session. Unless two users are hitting the application simulaneously, they can share a connection. Also note that one use can never need more than one connection at a time (unless you have threads.)

[OCA 8 book] [Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Other Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, TOGAF part 1 and part 2
I agree. Here's the link:
subject: About connection pooling
It's not a secret anymore!