-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 
Author Message
 Post subject: Connections not returned to Pool
PostPosted: Tue May 03, 2005 7:27 am 
Newbie

Joined: Tue May 03, 2005 6:44 am
Posts: 2
Location: Elemental Plane of Air
Hibernate version: 2.1.8

Mapping documents:
*** hibernate-service.xml ***

<server>
<mbean code="org.jboss.hibernate.jmx.Hibernate" name="jboss.har:service=wmsHibernate">
<depends>jboss.jca:service=LocalTxCM,name=OracleDS</depends>
<attribute name="SessionFactoryName">java:/ora/SessionFactory</attribute>
<attribute name="DatasourceName">java:/OracleDS</attribute>
<attribute name="Dialect">net.sf.hibernate.dialect.Oracle9Dialect</attribute>
<attribute name="MaxFetchDepth">3</attribute>
<attribute name="ReflectionOptimizationEnabled">true</attribute>
<attribute name="QueryCacheEnabled">true</attribute>
<attribute name="ShowSqlEnabled">false</attribute>
<attribute name="JdbcBatchSize">25</attribute>
<attribute name="JdbcScrollableResultSetEnabled">true</attribute>
<attribute name="CacheProviderClass">
net.sf.hibernate.cache.HashtableCacheProvider
</attribute>
</mbean>
</server>

*** oracle-ds.xml ***

<datasources>
<local-tx-datasource>
<jndi-name>OracleDS</jndi-name> <connection-url>jdbc:oracle:thin:@192.20.10.01:1521:MYSID</connection-url>
<driver-class>oracle.jdbc.driver.OracleDriver</driver-class>
<user-name>sys</user-name>
<password>admin</password>
<min-pool-size>5</min-pool-size>
<max-pool-size>50</max-pool-size>
<blocking-timeout-millis>50000</blocking-timeout-millis>
<idle-timeout-minutes>1</idle-timeout-minutes> <valid-connection-checker-class-name>org.jboss.resource.adapter.jdbc.vendor.OracleValidConnectionChecker</valid-connection-checker-class-name> <exception-sorter-class-name>org.jboss.resource.adapter.jdbc.vendor.OracleExceptionSorter</exception-sorter-class-name>
<metadata>
<type-mapping>Oracle9i</type-mapping>
</metadata>
</local-tx-datasource>
</datasources>


Code between sessionFactory.openSession() and session.close():
boolean user_found = false;
Session session = null;
try {
session = new ContextResources().getHibernateFactory().openSession();
Query query = session.createQuery("from TerminalUser as tu where tu.TuPassword = :paswd ");
query.setParameter("paswd",passwd);
Iterator it = query.iterate();
while(it.hasNext()) {
TerminalUser tu = (TerminalUser)it.next();
if ((tu.getId().getEmployeeId()).equalsIgnoreCase(uname)) {
user_found = true;
}
}
session.close();
//Setting session to null, just in case...
session = null;
}
catch(Exception e) {
e.printStackTrace(); //DEBUG
try {session.close();session = null;}catch(Exception e1) {}
throw new DataBaseException();
}


Name and version of the database you are using:
Oracle 9i v9.2.0.1.0


JBoss version: 4.0.1sp1

Hibernate tool: Hibernate Synchronizer

The code above is used inside a stateless session EJB.
It appears that even by calling session.close() the DB connection used does not return to the connection pool. I've also tried getting a connection directly from the connection pool and provide it to hibernate (in openSession() method), but no luck. My pool is only getting smaller...

Any thoughts on what I might be doing wrong?


Top
 Profile  
 
 Post subject:
PostPosted: Tue May 03, 2005 11:01 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 3:00 pm
Posts: 1816
Location: Austin, TX
Have you considered asking on the JBoss forums?


Top
 Profile  
 
 Post subject:
PostPosted: Tue May 10, 2005 6:19 am 
Newbie

Joined: Tue May 03, 2005 6:44 am
Posts: 2
Location: Elemental Plane of Air
Yes, but at that time the JBoss forum was down. I'll c/p the question there, if its more relevant. Thanks.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.