[hibernate-issues] [Hibernate-JIRA] Created: (HHH-3250) session.clear() throws NullPointerException intermittently

Arturo Campos (JIRA) noreply at atlassian.com
Wed Apr 23 18:18:33 EDT 2008


session.clear() throws NullPointerException intermittently
----------------------------------------------------------

                 Key: HHH-3250
                 URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-3250
             Project: Hibernate3
          Issue Type: Bug
          Components: core
    Affects Versions: 3.2.6
         Environment: Hibernate 3.2.6ga, Oracle 10g, JRE 1.5
            Reporter: Arturo Campos


Receiving the following NullPointerException sometimes when calling session.clear() .

java.lang.NullPointerException
	at org.hibernate.engine.StatefulPersistenceContext.clear(StatefulPersistenceContext.java:188)
	at org.hibernate.impl.SessionImpl.clear(SessionImpl.java:255)
...

Our GUI application tries to reuse a session as shown in the simplified method below. 
This method may be called repeteadly from a clear/refresh button in a GUI screen. Data changes (DAO fields updated) to the session 
may or may not be made at discretion of the user.

It is difficult to pinpoint the frequency as to when this happens. Sometimes the method may be called 10 times without incident. Try it
at some other time and  it may throw the exception after just couple of times. 

After the exception occurs the session becomes unusable and throws other exceptions if the user tries 
other operations such as save (update DB).

// Note: session instanciated elsewhere (cacheMode = NORMAL) 
public void sessionReset()
{
            m_session.getTransaction().rollback();
            m_session.clear();
            m_session.beginTransaction();
            load(); // query to load/reload records
}

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        



More information about the hibernate-issues mailing list