• 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
  • Ron McLeod
  • Paul Clapham
  • Tim Cooke
  • Devaka Cooray
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Rob Spoor
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
Bartenders:
  • Carey Brown
  • Roland Mueller

About connection pooling

 
Ranch Hand
Posts: 42
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Ranch Hand
Posts: 54
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
author & internet detective
Posts: 41967
911
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.)
 
I don't always make ads but when I do they're tiny
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic