>1 connection per user using Tomcat?
Hi all, I've created a connection pool on Tomcat 5 and during testing realised that I couldn't run more than 1 query to my web app i.e. I opened up multiple windows and ran each query at the same time. Is there any way (out of interest) of setting up the connection pool so that a user can be assigned more than 1 connection if they so wish?
Thanks
# 1
Usually a connection is retrieved from a pool when a transaction is performed.
This means that one connection is associated with one transaction not a user:
1) user logins
2) Get Connection
3) carry out a transaction
4) return connection to pool
5) Get Connection
6) carry out a transaction
7) return connection to pool
8) user logs out
You seem to be giving each user a connection which will lead to the issues you are having:
1) user logins
2) get connection
3) carries out a transaction
4) carries out another transaction
5) user logs out
6) return connection to pool
# 2
I probably should clarify - what I'm attempting to do is to assign 1 connection per transaction. When the web app runs its query to completion it returns the connection to the pool. It's when I run >1 transaction that the server keels over and throws an exception, hence why I was wondering if being able to assign >1 connection per user is possible.