-->
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.  [ 4 posts ] 
Author Message
 Post subject: Could initialize a collection [deadlock detected]
PostPosted: Tue Jan 20, 2009 12:03 am 
Newbie

Joined: Wed Dec 17, 2008 12:55 am
Posts: 3
Our application is made in EJB 3.0 with JBoss 4.2.2 as application server and Postgres 8.2 as Database server.
During one of the execution while querying an object using JPQL, I am getting the following exception.
This is the first time I have came across such an exception in our application.

Caused by: javax.persistence.PersistenceException: org.hibernate.exception.GenericJDBCException: could not initialize a collection: [com.barco.cms.service.perspectivemgt.Perspective.mPerspectiveWindows#350]
at org.hibernate.ejb.AbstractEntityManagerImpl.throwPersistenceException(AbstractEntityManagerImpl.java:629)
at org.hibernate.ejb.QueryImpl.getResultList(QueryImpl.java:73)
... 40 more
Caused by: org.hibernate.exception.GenericJDBCException: could not initialize a collection: [com.barco.cms.service.perspectivemgt.Perspective.mPerspectiveWindows#350]
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.loader.Loader.loadCollection(Loader.java:2001)
at org.hibernate.loader.collection.CollectionLoader.initialize(CollectionLoader.java:36)
at org.hibernate.persister.collection.AbstractCollectionPersister.initialize(AbstractCollectionPersister.java:565)
at org.hibernate.event.def.DefaultInitializeCollectionEventListener.onInitializeCollection(DefaultInitializeCollectionEventListener.java:60)
at org.hibernate.impl.SessionImpl.initializeCollection(SessionImpl.java:1716)
at org.hibernate.collection.AbstractPersistentCollection.forceInitialization(AbstractPersistentCollection.java:454)
at org.hibernate.engine.StatefulPersistenceContext.initializeNonLazyCollections(StatefulPersistenceContext.java:797)
at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:241)
at org.hibernate.loader.Loader.doList(Loader.java:2220)
at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2104)
at org.hibernate.loader.Loader.list(Loader.java:2099)
at org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:378)
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.ejb.QueryImpl.getResultList(QueryImpl.java:64)
... 40 more
Caused by: org.postgresql.util.PSQLException: ERROR: deadlock detected
Detail: Process 6432 waits for AccessShareLock on relation 116866 of database 16403; blocked by process 3344.
Process 3344 waits for AccessExclusiveLock on relation 116995 of database 16403; blocked by process 6432.
at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:1592)
at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1327)
at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:192)
at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:451)
at org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:350)
at org.postgresql.jdbc2.AbstractJdbc2Statement.executeQuery(AbstractJdbc2Statement.java:254)
at org.jboss.resource.adapter.jdbc.CachedPreparedStatement.executeQuery(CachedPreparedStatement.java:90)
at org.jboss.resource.adapter.jdbc.WrappedPreparedStatement.executeQuery(WrappedPreparedStatement.java:236)
at org.hibernate.jdbc.AbstractBatcher.getResultSet(AbstractBatcher.java:186)
at org.hibernate.loader.Loader.getResultSet(Loader.java:1787)
at org.hibernate.loader.Loader.doQuery(Loader.java:674)
at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:236)
at org.hibernate.loader.Loader.loadCollection(Loader.java:1994)
... 56 more

I am putting this in PostgreSQL forum as it involves postgres also.


Thanks in advance for reply
Hamdur


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jan 20, 2009 1:12 am 
Regular
Regular

Joined: Wed Apr 25, 2007 11:44 pm
Posts: 59
Quote:
Caused by: org.postgresql.util.PSQLException: ERROR: deadlock detected
Detail: Process 6432 waits for AccessShareLock on relation 116866 of database 16403; blocked by process 3344.
Process 3344 waits for AccessExclusiveLock on relation 116995 of database 16403; blocked by process 6432.


:O

how did u guys do that

please provide details

did u tried any other database say mysql


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jan 20, 2009 6:01 am 
Newbie

Joined: Wed Dec 17, 2008 12:55 am
Posts: 3
We came across only twice once when we are querying an entity and secondly from bulk native query. Its very rare and we are using postgeSQL only


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jan 21, 2009 12:25 am 
Regular
Regular

Joined: Wed Apr 25, 2007 11:44 pm
Posts: 59
hmm

so what kind of connection pool you are using

and are there any other applications that are accessing the same db (with or without hibernate)

?


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