Skip to Content.
Sympa Menu

grouper-dev - Re: RE: Re: [grouper-dev] Grouper session exception : ProbleminHibernateSession

Subject: Grouper Developers Forum

List archive

Re: RE: Re: [grouper-dev] Grouper session exception : ProbleminHibernateSession


Chronological Thread 
  • From: "Allen Chen" <>
  • To: "Chris Hyzer" <>
  • Cc: "grouper-dev" <>
  • Subject: Re: RE: Re: [grouper-dev] Grouper session exception : ProbleminHibernateSession
  • Date: Tue, 22 Jul 2008 22:54:53 +0800

It works well after set the timeout to 30000. And the time out exception doesn't happen by now.
Thank you very much.
 

Allen Chen
2008-07-22

发件人: Chris Hyzer
发送时间: 2008-07-22 22:16:39
收件人: Allen Chen; GW Brown, Information Systems an
抄送: grouper-dev
主题: RE: Re: [grouper-dev] Grouper session exception : ProbleminHibernateSession
 

Please change the checkout timeout to 30000 and let us know if there is an improvement.

 

Thanks,

chris

 

From: Allen Chen [mailto:]
Sent: Tuesday, July 22, 2008 7:13 AM
To: GW Brown, Information Systems an
Cc: grouper-dev
Subject: Re: Re: [grouper-dev] Grouper session exception : Problem inHibernateSession

 

Yes, I am using grouper 1.3.0. And database is Oracle 10.2.0.1.0.

 

And i set the grouper.hibernate.properties with following setting

 

hibernate.c3p0.max_size 16

hibernate.c3p0.min_size 5

hibernate.c3p0.timeout 100

hibernate.c3p0.max_statements 0

hibernate.c3p0.idle_test_period 50

hibernate.c3p0.acquire_increment 2

hibernate.c3p0.validate false

 

hibernate.c3p0.acquireRetryAttempts=2

hibernate.c3p0.acquireRetryDelay=500

hibernate.c3p0.checkoutTimeout=500

 

But the time out problems still turn up.

 


Allen Chen

2008-07-22


发件人: GW Brown, Information Systems and Computing

发送时间: 2008-07-22 16:36:37

收件人: Allen Chen; grouper-dev

抄送: grouper-users

主题: Re: [grouper-dev] Grouper session exception : Problem inHibernateSession

 

Allen,

It may be that the code is unable to connect to the database - or is very 

slow in doing so. There are a number of settings in 

grouper.hibernate.properties prefixed hibernate.c3p0. which control how the 

connection pool behaves - and links to the relevant documentation.

Are you using v1.3.0? Which database are you using? If you run the default 

HSQLDB database created by Grouper it only allows one connection - you need 

to run it as a server to allow >1 connection.

Gary

--On 22 July 2008 16:11 +0800 Allen Chen <> wrote:

> 

> 

> Every time I use the Grouper session, the following exception will happen

> time after time :

> 

> 2008-07-22 15:39:37,562: SQL Error: 0, SQLState: null

> 2008-07-22 15:39:37,562: An attempt by a client to checkout a Connection

> has timed out.

> 2008-07-22 15:39:37,562: Exception in uniqueResult: (class

> edu.internet2.middleware.grouper.internal.dao.hib3.Hib3MemberDAO),

> ByHqlStatic, query: 'from Hib3MemberDAO as m where      m.subjectId

> = :sid    and  m.subjectSourceId = :source and  m.subjectTypeId   =

> :type', cacheable: true, cacheRegion:

> edu.internet2.middleware.grouper.internal.dao.hib3.Hib3MemberDAO.FindBySu

> bject, tx type: nullBind var[0]: 'Param (class java.lang.String):

> 'sid'->'GrouperSystem', Bind var[1]: 'Param (class java.lang.String):

> 'type'->'application'Bind var[2]: 'Param (class java.lang.String):

> 'source'->'g:isa',

> edu.internet2.middleware.grouper.internal.dao.GrouperDAOException:

> Problem in HibernateSession: HibernateSession: isNew: true, isReadonly:

> true, grouperTransactionType: READONLY_NEW

> at

> edu.internet2.middleware.grouper.hibernate.HibernateSession.callbackHiber

> nateSession(HibernateSession.java:263)

> at

> edu.internet2.middleware.grouper.hibernate.ByHqlStatic.uniqueResult(ByHql

> Static.java:197)

> at

> edu.internet2.middleware.grouper.internal.dao.hib3.Hib3MemberDAO.findBySu

> bject(Hib3MemberDAO.java:168)

> at

> edu.internet2.middleware.grouper.MemberFinder.internal_findOrCreateBySubj

> ect(MemberFinder.java:183)

> at

> edu.internet2.middleware.grouper.MemberFinder.internal_findBySubject(Memb

> erFinder.java:176)

> at

> edu.internet2.middleware.grouper.GrouperSession.start(GrouperSession.java

> :107)

> at

> edu.grouper.support.GrouperInitServer.onCalled(GrouperInitServer.java:38)

> .........

> at

> edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor.runWork

> er(ThreadPoolExecutor.java:987)

> at

> edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor$Worker.

> run(ThreadPoolExecutor.java:528)

> at java.lang.Thread.run(Thread.java:595)

> Caused by: org.hibernate.exception.GenericJDBCException: Cannot open

> connection

> at

> org.hibernate.exception.SQLStateConverter.handledNonSpecificException(SQL

> StateConverter.java:103)

> at

> org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:

> 91)

> at

> org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.j

> ava:43)

> at

> org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.j

> ava:29)

> at

> org.hibernate.jdbc.ConnectionManager.openConnection(ConnectionManager.jav

> a:424)

> at

> org.hibernate.jdbc.ConnectionManager.getConnection(ConnectionManager.java

> :144)

> at

> org.hibernate.jdbc.AbstractBatcher.prepareQueryStatement(AbstractBatcher.

> java:139)

> at org.hibernate.loader.Loader.prepareQueryStatement(Loader.java:1538)

> at org.hibernate.loader.Loader.doQuery(Loader.java:661)

> at

> org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader

> .java:224)

> at org.hibernate.loader.Loader.doList(Loader.java:2211)

> at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2095)

> at org.hibernate.loader.Loader.list(Loader.java:2090)

> at org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:375)

> at

> org.hibernate.hql.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:3

> 38)

> at

> org.hibernate.engine.query.HQLQueryPlan.performList(HQLQueryPlan.java:172

> )

> at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1121)

> at org.hibernate.impl.QueryImpl.list(QueryImpl.java:79)

> at

> org.hibernate.impl.AbstractQueryImpl.uniqueResult(AbstractQueryImpl.java:

> 811)

> at

> edu.internet2.middleware.grouper.hibernate.ByHqlStatic$1.callback(ByHqlSt

> atic.java:204)

> at

> edu.internet2.middleware.grouper.hibernate.HibernateSession.callbackHiber

> nateSession(HibernateSession.java:211)

> ... 59 more

> Caused by: java.sql.SQLException: An attempt by a client to checkout a

> Connection has timed out.

> at com.mchange.v2.sql.SqlUtils.toSQLException(SqlUtils.java:104)

> at com.mchange.v2.sql.SqlUtils.toSQLException(SqlUtils.java:65)

> at

> com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool.checkoutPooledConnectio

> n(C3P0PooledConnectionPool.java:262)

> at

> com.mchange.v2.c3p0.PoolBackedDataSource.getConnection(PoolBackedDataSour

> ce.java:94)

> at

> org.hibernate.connection.C3P0ConnectionProvider.getConnection(C3P0Connect

> ionProvider.java:56)

> at

> org.hibernate.jdbc.ConnectionManager.openConnection(ConnectionManager.jav

> a:421)

> ... 75 more

> Caused by: com.mchange.v2.resourcepool.TimeoutException: internal --

> timeout at awaitAcquire()

> at

> com.mchange.v2.resourcepool.BasicResourcePool.awaitAcquire(BasicResourceP

> ool.java:970)

> at

> com.mchange.v2.resourcepool.BasicResourcePool.checkoutResource(BasicResou

> rcePool.java:208)

> at

> com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool.checkoutPooledConnectio

> n(C3P0PooledConnectionPool.java:260)

> ... 78 more

> 2008-07-22 15:39:37,578:

> [cn.edu.scut.grouper.support.mule.GrouperInitServer] Problem in

> HibernateSession: HibernateSession: isNew: true, isReadonly: true,

> grouperTransactionType: READONLY_NEW

> 

> 

> 

> the session used in my code is as follows:

> 

> 

> GrouperSession session = null;

> try {

> session = GrouperSession.start(SubjectFinder.findById("GrouperSystem",

> "application", InternalSourceAdapter.ID));

> 

> 

> // using the session to do something

> 

> } catch (Exception e) {

> ErrorLog.error(this.getClass(), e.getMessage());

> return "Exception happened:"+e.getMessage();

> }finally{

> GrouperSession.stopQuietly(session);

> }

> 

> I search on Google, it's said that there's something wrong with c3po.

> Do the grouper developers notice this bug and fix it already?

> 

> 

> __________________________________________________

> 

> Allen Chen

> 2008-07-22

----------------------

GW Brown, Information Systems and Computing




Archive powered by MHonArc 2.6.16.

Top of Page