I'm all hung up ...
I seem to have hit a problem with my struts application.
I am using -
1. Apache's Database Connection Pool.
2. The DAO pattern.
4. Tomact 5.0x
I have a problem where the Action classes, for say listing for a Client. This listing also searches for Jobs currently available for the client.
I have an action class that gets a client, and then gets the jobs for the client. All is well and good with this - it works beautifully, its succinct and easily maintained.
My problem comes with scalability. If I submit the http://localhost:8080/getClient.do?clientId=10
url from 2 or more browsers, they will all queue until the first comes back. It feels like the requests are queued up in the action.
Now I've looked around a lot, and have found very little by way of suggestions on how to fix this, or even acknowleding it.
I feel I am missing something here. I understand the action is a single instance, but should the threads not be running simulatenously? My DAO contains a reference to a simple datasource, which will freely give up connections to the DAOs, the processing doesn't seem to continue until the connection that came out first is returned to the pool.
Other Actions using the connection pool continue to function fine irrespective of the ClientAction being 'busy'.
Any directions would be gladly received.
I'm a bit desperate to fix this. I've seen something about ThreadLocal and filters, and I've also considered creating multiple copies of the action and giving them different names, but this seems very wrong indeed.