-->
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.  [ 5 posts ] 
Author Message
 Post subject: Max. no. of connections required for Hibernate session
PostPosted: Thu Nov 24, 2005 2:11 am 
Newbie

Joined: Wed May 25, 2005 10:53 pm
Posts: 13
Hi.

I want to know what are the min. and max. no. of JDBC connections required by Hibernate session. I want configure it for my application.

Regards,
Rakesh S


Top
 Profile  
 
 Post subject:
PostPosted: Thu Nov 24, 2005 2:40 am 
Expert
Expert

Joined: Thu Jan 29, 2004 2:31 am
Posts: 362
Location: Switzerland, Bern
For one Hibernate session you need one Connection.

HTH
Ernst


Top
 Profile  
 
 Post subject:
PostPosted: Thu Nov 24, 2005 3:08 am 
Expert
Expert

Joined: Mon Jul 04, 2005 5:19 pm
Posts: 720
are you talking about pool size? this depends on business requirements ;)


Top
 Profile  
 
 Post subject:
PostPosted: Fri Nov 25, 2005 12:07 am 
Newbie

Joined: Wed May 25, 2005 10:53 pm
Posts: 13
Hi Ernst and Dennis. Thanks for your replies. But this doesnt solve my problem.

I have tried out with foll. settings in my application :

I use JBoss as my application server, Teradata as the database and my datasource file looks like this:

<datasources>
<local-tx-datasource>
<jndi-name>CrmDS</jndi-name>
<connection-url>jdbc:teradata://10.77.198.6/DATABASE=tcrm6_st2plus_nov10,TMODE=TERA,LOB_SUPPORT=OFF</connection-url>
<driver-class>com.ncr.teradata.TeraDriver</driver-class>
<user-name>tcrm6_st2plus_nov10</user-name>
<password>tcrm6</password>
<min-pool-size>1</min-pool-size>
<max-pool-size>5</max-pool-size>
<idle-timeout-minutes>5</idle-timeout-minutes>
</local-tx-datasource>
</datasources>

I get the foll. errors:

2005-11-24 10:42:59,415 ERROR [net.sf.hibernate.util.JDBCExceptionReporter] Cannot open connection
org.jboss.util.NestedSQLException: No ManagedConnections available within configured blocking timeout ( 5000 [ms] ); - nested throwable: (javax.resource.ResourceException: No ManagedConnections available within configured blocking timeout ( 5000 [ms] ))
at org.jboss.resource.adapter.jdbc.WrapperDataSource.getConnection(WrapperDataSource.java:106)
at net.sf.hibernate.connection.DatasourceConnectionProvider.getConnection(DatasourceConnectionProvider.java:59)
at net.sf.hibernate.impl.BatcherImpl.openConnection(BatcherImpl.java:278)
at net.sf.hibernate.impl.SessionImpl.connect(SessionImpl.java:3297)
at net.sf.hibernate.impl.SessionImpl.connection(SessionImpl.java:3277)
at com.teradata.tap.system.persistence.hibernate.MacroSequenceGenerator.genId(MacroSequenceGenerator.java:118)
at com.teradata.tap.system.persistence.hibernate.MacroSequenceGenerator.genIdForEJB(MacroSequenceGenerator.java:99)
at com.teradata.tap.system.persistence.hibernate.ejb.SequenceGeneratorBean.next(SequenceGeneratorBean.java:100)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at org.jboss.ejb.StatelessSessionContainer$ContainerInterceptor.invoke(StatelessSessionContainer.java:683)
at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invoke(CachedConnectionInterceptor.java:185)
at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:84)
at org.jboss.ejb.plugins.AbstractTxInterceptorBMT.invokeNext(AbstractTxInterceptorBMT.java:144)
at org.jboss.ejb.plugins.TxInterceptorBMT.invoke(TxInterceptorBMT.java:62)
at org.jboss.ejb.plugins.StatelessSessionInstanceInterceptor.invoke(StatelessSessionInstanceInterceptor.java:72)
at org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:118)
at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:191)
at org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invoke(ProxyFactoryFinderInterceptor.java:122)
at org.jboss.ejb.StatelessSessionContainer.internalInvoke(StatelessSessionContainer.java:331)
at org.jboss.ejb.Container.invoke(Container.java:700)
at org.jboss.ejb.plugins.local.BaseLocalProxyFactory.invoke(BaseLocalProxyFactory.java:375)
at org.jboss.ejb.plugins.local.StatelessSessionProxy.invoke(StatelessSessionProxy.java:83)
at $Proxy227.next(Unknown Source)



However when the min-pool-size is 2 and max-pool-size is 20 my application runs absolutely fine.


Does JBoss or Teradata database has anything to do with this??

Regards,
Rakesh S


Top
 Profile  
 
 Post subject:
PostPosted: Fri Nov 25, 2005 1:02 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 7:19 pm
Posts: 2364
Location: Brisbane, Australia
It depends on your concurrency level. You have no concurrent operations then you need one connection. Otherwise, you will require more, that figure depends on the usage profile of the application.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 5 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.