I'm using a XA datasource to a Oracle g11 database in my
EJB (SLSB). Sometimes I get a SQLException while doing some queries, message: ORA-0392: exceeded session limit on CPU usage (Oracle g11).
The database admin has set a resource limit for each user session. I can't change this limit. Everytime the
JBoss opens a new connection to the database, a new session is started. If all my queries use the same connection, they might use too much CPU time in total, so a SQLException is thrown.
I tried to solve the problem by closing the actual connection and get a new connection using the datasource (getConnection()). Afterwards I retry my statement. Now I get a new SQLException: "ORA-01012: not logged on".
Now my questions:
Is it possible, the JBoss don't realize the problem and keeps the useless connection in his pool after I released it (with close())? I didn't set the pool limits for the datasource, so the JBoss might have only one connection? And calling getConnection() on the datasource returns the same useless connection I had before?
Does anyone have some information about the pooling behavior? I want to know when the JBoss decides to create a new connection or to give me an old connection.
Any idea how to solve my problem? Can I force the JBoss to kill the useless connection? I don't want to manage my own connections using some
JDBC stuff.
Thanks, Helmut
By the way, I'm using a JBoss AS 7.1 (standalone)