Thank you very much Pradeep, and for your
test. Actually, we did some similiar tests, and I want to share results here:
1. jboss 2.4.8, Oracle9i, set MaxSize=2, and when jboss started, I have connection by using user, pwd (dba,dba); in my
java code, we using getConnection(usr, pwd), so, when we try different users for example user A, B, C. Checked Oracle session, it shows 4 connections there: dba, A,B,C.
2. Same test setting as above, using same users (A) running on 2 applications, checked oracle session, it shows 2 connections there: A,A;
3. Same test setting as above except set MaxSize =1, using same users running on 2 applications at the same time, in oracle session it shows 1 connection there: A. And one of applications catched the exception as Pradeep's test.
So, which means:
1. jboss do create a connection pool and retrieve an instance from the pool (instead of creating new connection each time)when getConnection(usr,pwd) is called;
2. however, it seems at least in jboss2.4.8, jboss maintains different connection pool for different usr,pwd, even if we only bound 1 datasource with jndi name when jboss started;
3. Same parameters like MinSize, MaxSize are used by different connection pools for different usr, pwd.
Really appreciated if anyone have any other further comments
Thanks a lot
David