Skip to Content.
Sympa Menu

grouper-dev - Grouper session exception : Problem in HibernateSession

Subject: Grouper Developers Forum

List archive

Grouper session exception : Problem in HibernateSession


Chronological Thread 
  • From: "Allen Chen" <>
  • To: "grouper-dev" <>
  • Cc: "grouper-users" <>
  • Subject: Grouper session exception : Problem in HibernateSession
  • Date: Tue, 22 Jul 2008 16:11:27 +0800

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.FindBySubject, 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.callbackHibernateSession(HibernateSession.java:263)
at edu.internet2.middleware.grouper.hibernate.ByHqlStatic.uniqueResult(ByHqlStatic.java:197)
at edu.internet2.middleware.grouper.internal.dao.hib3.Hib3MemberDAO.findBySubject(Hib3MemberDAO.java:168)
at edu.internet2.middleware.grouper.MemberFinder.internal_findOrCreateBySubject(MemberFinder.java:183)
at edu.internet2.middleware.grouper.MemberFinder.internal_findBySubject(MemberFinder.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.runWorker(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(SQLStateConverter.java:103)
at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:91)
at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)
at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:29)
at org.hibernate.jdbc.ConnectionManager.openConnection(ConnectionManager.java: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:338)
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(ByHqlStatic.java:204)
at edu.internet2.middleware.grouper.hibernate.HibernateSession.callbackHibernateSession(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.checkoutPooledConnection(C3P0PooledConnectionPool.java:262)
at com.mchange.v2.c3p0.PoolBackedDataSource.getConnection(PoolBackedDataSource.java:94)
at org.hibernate.connection.C3P0ConnectionProvider.getConnection(C3P0ConnectionProvider.java:56)
at org.hibernate.jdbc.ConnectionManager.openConnection(ConnectionManager.java:421)
... 75 more
Caused by: com.mchange.v2.resourcepool.TimeoutException: internal -- timeout at awaitAcquire()
at com.mchange.v2.resourcepool.BasicResourcePool.awaitAcquire(BasicResourcePool.java:970)
at com.mchange.v2.resourcepool.BasicResourcePool.checkoutResource(BasicResourcePool.java:208)
at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool.checkoutPooledConnection(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



Archive powered by MHonArc 2.6.16.

Top of Page