aspose file tools*
The moose likes JDBC 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
Bookmark "About connection pooling" Watch "About connection pooling" New topic
Author

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.
Thanks


SCJP 1.4, SCWCD
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,
Rudy.
Jeanne Boyarsky
internet detective
Marshal

Joined: May 26, 2003
Posts: 30546
    
150

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.)


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: About connection pooling