org.hibernate.TransientObjectException: object references an unsaved transient instance - save the transient instance before flushing: com.aphroditesocial.web.model.UserProfile

tip
Click on the to mark the solution that helps you, Samebug will learn from it.
As a community member, you’ll be rewarded for you help.
  1. 0

    Problems with many to many relation with hibernate

    Stack Overflow | 6 months ago | Jose David García
    org.hibernate.TransientObjectException: object references an unsaved transient instance - save the transient instance before flushing: com.aphroditesocial.web.model.UserProfile

    Root Cause Analysis

    1. org.hibernate.TransientObjectException

      object references an unsaved transient instance - save the transient instance before flushing: com.aphroditesocial.web.model.UserProfile

      at org.hibernate.engine.internal.ForeignKeys.getEntityIdentifierIfNotUnsaved()
    2. Hibernate
      ActionQueue.executeActions
      1. org.hibernate.engine.internal.ForeignKeys.getEntityIdentifierIfNotUnsaved(ForeignKeys.java:294)
      2. org.hibernate.type.EntityType.getIdentifier(EntityType.java:537)
      3. org.hibernate.type.ManyToOneType.nullSafeSet(ManyToOneType.java:165)
      4. org.hibernate.persister.collection.AbstractCollectionPersister.writeElement(AbstractCollectionPersister.java:899)
      5. org.hibernate.persister.collection.AbstractCollectionPersister.recreate(AbstractCollectionPersister.java:1308)
      6. org.hibernate.action.internal.CollectionRecreateAction.execute(CollectionRecreateAction.java:67)
      7. org.hibernate.engine.spi.ActionQueue.executeActions(ActionQueue.java:465)
      7 frames