-
1. Re: Connection pooling to datasource - AS7.1, connections are not released
nickarls Feb 10, 2012 7:57 AM (in response to mihovil)What it the scope of the EJB? Is a @PreDestroy method invoked if you add one?
-
2. Re: Connection pooling to datasource - AS7.1, connections are not released
ctomc Feb 10, 2012 8:21 AM (in response to mihovil)Mihovil hi,
can you try with latest nightly build (this one is really close to final) as there ware some bugs regarding this in CR1
let us know if it still occures https://ci.jboss.org/jenkins/job/JBoss-AS-7.x-latest/
--
tomaz
-
3. Re: Connection pooling to datasource - AS7.1, connections are not released
mihovil Feb 10, 2012 9:52 AM (in response to ctomc)Hi!
Regarding scope of EJB - it is stateless session bean. We never set this scope explicitly (it is not managed but session bean). We've put a newest build and @PreDestroy method is not invoked when we add one...
Mihovil
-
4. Re: Connection pooling to datasource - AS7.1, connections are not released
mihovil Feb 10, 2012 9:53 AM (in response to mihovil)Tomaz, and yes - and we have now the latest version AS-7.x as you suggested...
thx
-
5. Re: Connection pooling to datasource - AS7.1, connections are not released
ctomc Feb 10, 2012 10:04 AM (in response to mihovil)For stateless session bean @PreDestroy will be called really rearly as app server keeps a pool(size is configurable, default is 20) of them alive at all times.
What are you doing in your code that keeps connection open? do you work directly with connection or jus trough EntityManager?
Can you create an isolated example application so we can debug/fix this.
--
tomaz
-
6. Re: Connection pooling to datasource - AS7.1, connections are not released
nickarls Feb 10, 2012 10:26 AM (in response to ctomc)What would happen if the size of the stateless EJB pool is larger than the connection pool max?
Since the stateless EJBs aren't destroyed at logout (as Tomaz said), I guess the behaviour of the un-released connection is expected...
-
7. Re: Connection pooling to datasource - AS7.1, connections are not released
mihovil Feb 10, 2012 10:44 AM (in response to nickarls)Hi,
This is screenshot before we log in into application - 18 available and 2 active
this is after we login into application:
this is after we logout from application:
So our pool of connections is decreasing and we cannot allow this because we expect more then 200 logins and logouts to application daily.
We are not doing anything with entity manager - the connections are created automatically - but unfortunately not destroyed... that is the problem....
When we create connections by our own and we destroy them it works ok. But we have to find a way to keep this pool available whith multiple login/logouts....
thx
Mihovil
-
8. Re: Connection pooling to datasource - AS7.1, connections are not released
smarlow Feb 10, 2012 10:57 AM (in response to mihovil)The entity manager will not hold onto the db connections either. If the entity manager uses a db connection, in a JTA transaction, the db connection should be returned (to the db connection pool) after the jta transaction completes. If the entity manager is used outside of a JTA transaction, the db connection should be returned to the db connection pool after the entity manager invocation.
If your on an older AS 7.x release, try the latest nightly build.
If you still see this problem after switching to the nightly build, a deeper look will be required.
A deeper look into this problem, will be to find what is holding the db connections. Try using the Eclipse Memory Analyzer to look at the connections and what (besides the app server db pool) is referencing them.
Scott
-
9. Re: Connection pooling to datasource - AS7.1, connections are not released
ctomc Feb 10, 2012 11:02 AM (in response to mihovil)how is your datasource configured?
can you try with use-ccm="true" and spy="true" flags
and set "org.jboss.jdbc" logging category to DEBUG
-
10. Re: Connection pooling to datasource - AS7.1, connections are not released
smarlow Feb 10, 2012 11:24 AM (in response to ctomc)Good idea Tomaz, that might be easier to try than bringing out the MAT tools. I'm still curious as to which AS7 build is used and whether the problems recreate on the nightly build.
-
11. Re: Connection pooling to datasource - AS7.1, connections are not released
ctomc Feb 10, 2012 11:44 AM (in response to smarlow)Scott, AFAIK it is yestedays/todays build as yesterady we helped solve some other problem with Mihovil
--
tomaz
-
12. Re: Connection pooling to datasource - AS7.1, connections are not released
mihovil Feb 11, 2012 4:33 AM (in response to ctomc)Hi,
we tried this also, without progress... unfortunatelly, we'll have to go back to AS6 becaouse of lack of time and sometimes later investigate why AS7.1 do not keep connections while AS6.0 do that right. Attached is our standalone.xml datasource configuration just to put all info here...
thx, Mihovil
<subsystem xmlns="urn:jboss:domain:datasources:1.0">
<datasources>
<datasource jta="true" jndi-name="java:/LarisDS" pool-name="LarisDS" enabled="true" use-java-context="true" use-ccm="true">
<connection-url>jdbc:oracle:thin:@host-name.home:1521:sid-name</connection-url>
<driver>ojdbc6.jar</driver>
<transaction-isolation>TRANSACTION_READ_COMMITTED</transaction-isolation>
<security>
<user-name>user-deleted</user-name>
<password>password-deleted</password>
</security>
<statement>
<prepared-statement-cache-size>0</prepared-statement-cache-size>
</statement>
</datasource>
<drivers>
<driver name="ojdbc6.jar" module="com">
<xa-datasource-class>oracle.jdbc.xa.client.OracleXADataSource</xa-datasource-class>
</driver>
</drivers>
</datasources>
</subsystem>
-
13. Re: Connection pooling to datasource - AS7.1, connections are not released
mihovil Feb 11, 2012 9:03 AM (in response to mihovil)Hi Everyone!
Bringing good news - JBoss 7.1 is ok, our code is not
Found an obscure error when releasing connections by ourselves, fixed it and now everything regarding connections works. Closing this. thx for hints.
Cheers
Mihovil
-
14. Re: Connection pooling to datasource - AS7.1, connections are not released
alesj Feb 11, 2012 1:41 PM (in response to mihovil)Found an obscure error when releasing connections by ourselves, fixed it and now everything regarding connections works. Closing this. thx for hints.
btw: why are you actully handling connections yourself?