In order to check the Pooling behavior, I was trying the following (after configuring an oracle database as datasource) :
//get datasource using jndi
Connection conn = datasource.getConnection("user1", "pwd1");
conn = datasource.getConnection("user2", "pwd2");
Then, I checked the sessions in the database. It says : 1 alive session for user "user2".
After some 15 minutes, I checked again. The database now says : 1 alive session for user "user1" !
Could somebody explain this behavior ? When does a connection in a Pool finally get closed ?
In some cases, I also see that 3 other connections to database were created for "user1" after some time. From the logs, this seems to happen after the Idle Remover run.
And, no, I haven't set minSize/maxSize for the datasource.