I've developed a HTTP Servlet which connects to an Oracle Database. On my Weblogic logs, I get the error : Cannot obtain XAConnection weblogic.common.resourcepool.ResourceLimitException: No resources currently available in pool Kitry_InWebo to allocate to applications, please increase the size of the pool and retry.
I suspect my application to not release Database connection so, after a while, there are no more connection available.
My questions is how do I manage my DB connexion inside my HTTP Servlet ?
For the moment, I init Datasource in the init method:
ds = (DataSource)ic.lookup(dataSourceName);
then in the doGet method I open a new connection, execute a statement and close the connection:
// Get a DB connection
conn = ds.getConnection();
stmt = conn.createStatement();
// Execute Statement
rs = stmt.executeQuery("select * from dual");
while (rs.next()) {
staffCode = rs.getString(1);
}
conn.close();
It seems to be a good approach but I reach the maximum number connection. So what's wrong ?!
Regards,