Harjinder,
It sounds that the error has to do with the number of connections to the database the Container maintains in the connection pool (for db such connections are obtained through
javax.sql.DataSource connection factory).
Container can be configured on a minimum and maximum number of connections to a particular database (which it maintains in the connection pool). Maximum number implies how many connections to a database can be used at the same time. Eg, if maximum number is 50 then an
ejb application can use up to 50 connections at the same time. If all connections are being used and another connection needs to be obtained by the ejb application then the Container throws an error indicating that the maximum number of connections has exceeded the limit.
I see two things that can help to solve the problem
1. Ensure that all connections are closed when the bean's method is completed. (If connection is left open it never goes back to the pool and therefore the risk of running out of connections increases)
2. Increase maximum number of connections to a database the Container can maintain.
One should try to work out how many transactions an application requires at any given time. It obviously depends on how the application is used (eg, how many concurrent users can there be at any given time) and how the connections are used (eg, does bean's method use one connection or it uses several connections that cannot be shared withing the same transaction). I'd like to know the magic formula on how to work this number out
Would be interesting to hear other ranchers' thoughts on this subject.