Hibernate JIRA | Gábor Varga | 7 months ago
  1. 0

    When calling {{StatelessSession.get(Class, Serializable, LockMode)}} with a {{null}} {{LockMode}} argument, a {{NullPointerException}} is thrown from the following code path: {code} java.lang.NullPointerException at org.hibernate.persister.entity.AbstractEntityPersister.load( at org.hibernate.persister.entity.AbstractEntityPersister.load( at org.hibernate.internal.StatelessSessionImpl.get( at org.hibernate.internal.StatelessSessionImpl.get( {code} A self-contained demo is available in [^], it's runnable with {{mvn clean test}}. When the counterpart {{Session.get(Class<T>, Serializable, LockMode)}} is called with a {{null}} {{LockMode}}, it doesn't throw an exception (and works just fine). It seems like the {{LockOptions}} instance in {{AbstractEntityPersister.getAppropriateLoader(LockOptions, SharedSessionContractImplementor)}} has different values for its {{lockMode}} field: {{LockMode.NONE}} in case of a stateful {{Session}}, and {{null}} in case of a {{StatelessSession}}. So {{getLoaders().get(null)}} returns a {{null}} {{UniqueEntityLoader}}, and attempting to call {{UniqueEntityLoader.load(Serializable, Object, SharedSessionContractImplementor, LockOptions)}} will throw the {{NullPointerException}}. In case of a stateful {{Session}}, the {{LoadEvent(Serializable, String, Object, LockOptions, boolean, EventSource)}} constructor has the following code: {code:java} if ( lockOptions.getLockMode() == null ) { lockOptions.setLockMode(DEFAULT_LOCK_MODE); } {code} There is no similar default value check for the {{StatelessSession}} code path. Maybe the {{StatelessSession}} should set the default {{LockMode.NONE}} lock mode when a {{null}} argument is passed? It would be more in line with the stateful {{Session}}, and would not throw {{NullPointerException}}.

    Hibernate JIRA | 7 months ago | Gábor Varga
  2. 0
    The Fragment was destroyed, and getActivity() returned null. Don't destroy the Fragment.
  3. 0

    Android: Saving Map State in Google map

    Stack Overflow | 1 year ago | Junie Negentien
    java.lang.RuntimeException: Unable to resume activity {com.ourThesis.junieNegentien2015/com.ourThesis.junieNegentien2015.MainActivity}: java.lang.NullPointerException
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

    Not finding the right solution?
    Take a tour to get the most out of Samebug.

    Tired of useless tips?

    Automated exception search integrated into your IDE

    Root Cause Analysis

    1. java.lang.NullPointerException

      No message provided

      at org.hibernate.persister.entity.AbstractEntityPersister.load()
    2. Hibernate
      1. org.hibernate.persister.entity.AbstractEntityPersister.load(
      2. org.hibernate.persister.entity.AbstractEntityPersister.load(
      3. org.hibernate.internal.StatelessSessionImpl.get(
      4. org.hibernate.internal.StatelessSessionImpl.get(
      4 frames