Restricting connection pool - server or client side
Not sure if my question is relevant to this forum but I'll give it a shot.
I've deployed a web app on Tomcat and need to restrict the number of users connected to the database at any one time. I've looked at implementing a connection pool restriction client side but would this restriction needed to be placed server side? If so, could someone please point me in the right direction?
Many thanks
# 1
As I understand it:
The DBA for your database sets how many connections (max) your server is allowed. In your server, set the max connection equal to whatever the DBA has set for the database. He should be able to help you determine the 'min' and 'size' for connections to set on the server side too. For example, if you expect 100 users of your application to be logged on at the same time, only a small percentage of them will be using a connection at exactly the same time (for this example of 100 people, it may be a typically 3 with a peak of 4). Therefore I would set the minimum to 3, size to 4 and max to 10(?). Complicating all this is any other application currently running or will run in the future on the server that accesses that connection pool. If that application also has 100 end users on at the same time, then your min,size, max needs to be adjusted accordingly.
To test your code to see if it doesnt return connections, and how it handles no connecitons availabie, you can set min=1, size=1, max=1.
There is no connnection restrictions to be set on the client side since all connection code runs on the server only.