[hibernate-issues] [Hibernate-JIRA] Created: (HHH-6458) AbstractPersistentCollection throws NullPointerException in highly concurrent situation

Yiming Du (JIRA) noreply at atlassian.com
Tue Jul 19 17:10:17 EDT 2011


AbstractPersistentCollection throws NullPointerException in highly concurrent situation
---------------------------------------------------------------------------------------

                 Key: HHH-6458
                 URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-6458
             Project: Hibernate Core
          Issue Type: Bug
          Components: core
    Affects Versions: 3.3.1
         Environment: Websphere + AIX + DB2 9.7.4
            Reporter: Yiming Du


Lately when doing stress test, a NullPointerException was sometimes being thrown within Hibernate class AbstractPersistentCollection. The excpetion happened only in highly concurrent situation.

We're using Websphere, here's the stack trace in Webshpere's log.
[7/19/11 12:31:59:679 EDT] 00000039 SystemErr     R java.lang.NullPointerException
[7/19/11 12:31:59:680 EDT] 00000039 SystemErr     R 	at org.hibernate.collection.AbstractPersistentCollection.isConnectedToSession(AbstractPersistentCollection.java:196)
[7/19/11 12:31:59:680 EDT] 00000039 SystemErr     R 	at org.hibernate.collection.AbstractPersistentCollection.setCurrentSession(AbstractPersistentCollection.java:429)
[7/19/11 12:31:59:681 EDT] 00000039 SystemErr     R 	at org.hibernate.event.def.OnLockVisitor.processCollection(OnLockVisitor.java:61)
[7/19/11 12:31:59:681 EDT] 00000039 SystemErr     R 	at org.hibernate.event.def.AbstractVisitor.processValue(AbstractVisitor.java:124)
[7/19/11 12:31:59:681 EDT] 00000039 SystemErr     R 	at org.hibernate.event.def.AbstractVisitor.processValue(AbstractVisitor.java:84)
[7/19/11 12:31:59:681 EDT] 00000039 SystemErr     R 	at org.hibernate.event.def.AbstractVisitor.processEntityPropertyValues(AbstractVisitor.java:78)
[7/19/11 12:31:59:681 EDT] 00000039 SystemErr     R 	at org.hibernate.event.def.AbstractVisitor.process(AbstractVisitor.java:146)
[7/19/11 12:31:59:681 EDT] 00000039 SystemErr     R 	at org.hibernate.event.def.AbstractReassociateEventListener.reassociate(AbstractReassociateEventListener.java:102)
[7/19/11 12:31:59:682 EDT] 00000039 SystemErr     R 	at org.hibernate.event.def.DefaultLockEventListener.onLock(DefaultLockEventListener.java:82)
[7/19/11 12:31:59:682 EDT] 00000039 SystemErr     R 	at org.hibernate.impl.SessionImpl.fireLock(SessionImpl.java:611)
[7/19/11 12:31:59:682 EDT] 00000039 SystemErr     R 	at org.hibernate.impl.SessionImpl.lock(SessionImpl.java:603)
[7/19/11 12:31:59:682 EDT] 00000039 SystemErr     R 	at com.silanis.idmgr.request.ConfigurationCache.shouldRefresh(ConfigurationCache.java:99)
[7/19/11 12:31:59:682 EDT] 00000039 SystemErr     R 	at com.silanis.idmgr.request.ConfigurationCache.getConfiguration(ConfigurationCache.java:59)


Further investigation revealed the line of code in our application that caused the exception:
				session.lock( config, LockMode.READ);
				
It's certain that neither session nor config object is null when the call is made. config is a persistent object which has associations and collections of other entity instances. We use lock function to perform a version check. 

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the hibernate-issues mailing list