org.hibernate.envers.exception.AuditException: Unable to create revision because of non-active transaction

Stack Overflow | Stephan B. | 8 months ago
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

    Hibernate Envers not Finding JPA Transaction:

    Stack Overflow | 8 months ago | Stephan B.
    org.hibernate.envers.exception.AuditException: Unable to create revision because of non-active transaction
  2. 0

    Getting Error on entity persistence using hibernate

    GitHub | 9 months ago | bruce-genhot
    java.lang.NoSuchMethodError: org.hibernate.event.spi.EventSource.accessTransaction()Lorg/hibernate/Transaction;
  3. 0

    How to Avoid org.hibernate.exception.LockTimeoutException in Hibernate

    Stack Overflow | 3 years ago | Thomas Nishanth
    org.hibernate.exception.ConstraintViolationException: could not execute statement
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    Exception in thread "main" org.hibernate.exception.ConstraintViolationException: could not execute statement

    Stack Overflow | 4 years ago | gstackoverflow
    org.hibernate.exception.ConstraintViolationException: could not execute statement
  6. 0

    The entity contains the following field: @ManyToMany(cascade = {CascadeType.PERSIST}) @JoinTable( name = "Apples", joinColumns = {@JoinColumn(name = "storeId", nullable = false)}, inverseJoinColumns = {@JoinColumn(name = "appleId", nullable = false)} ) public Set<Apple> apples = new HashSet<Apple>(); An exception is thrown when saving the entity: java.lang.NullPointerException at org.hibernate.envers.entities.EntitiesConfigurations.getToPropertyNames(EntitiesConfigurations.java:155) at org.hibernate.envers.event.BaseEnversEventListener.addCollectionChangeWorkUnit(BaseEnversEventListener.java:121) at org.hibernate.envers.event.BaseEnversEventListener.generateBidirectionalCollectionChangeWorkUnits(BaseEnversEventListener.java:90) at org.hibernate.envers.event.EnversPostInsertEventListenerImpl.onPostInsert(EnversPostInsertEventListenerImpl.java:60) at org.hibernate.action.internal.EntityIdentityInsertAction.postInsert(EntityIdentityInsertAction.java:149) at org.hibernate.action.internal.EntityIdentityInsertAction.execute(EntityIdentityInsertAction.java:102) In that particular method: public Set<String> getToPropertyNames(String fromEntityName, String fromPropertyName, String toEntityName) { Set<String> entityAndParentsNames = getEntityAndParentsNames(fromEntityName); Set<String> toPropertyNames = new HashSet<String>(); for (RelationDescription relationDescription : getRelationDescriptions(toEntityName)) { String relToEntityName = relationDescription.getToEntityName(); String mappedByPropertyName = relationDescription.getMappedByPropertyName(); if (entityAndParentsNames.contains(relToEntityName) && mappedByPropertyName.equals(fromPropertyName)) { toPropertyNames.add(relationDescription.getFromPropertyName()); } } return toPropertyNames; } mappedByPropertyName is null since RelationDescription can have null mappedByPropertyName when invoked at: EntityConfiguration public void addToManyMiddleRelation(String fromPropertyName, String toEntityName) { relations.put(fromPropertyName, new RelationDescription(fromPropertyName, RelationType.TO_MANY_MIDDLE, toEntityName, null, null, null, null, true)); }

    Hibernate JIRA | 5 years ago | Clement Pang
    java.lang.NullPointerException

    2 unregistered visitors
    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. org.hibernate.envers.exception.AuditException

      Unable to create revision because of non-active transaction

      at org.hibernate.envers.event.spi.BaseEnversEventListener.checkIfTransactionInProgress()
    2. org.hibernate.envers
      EnversPostInsertEventListenerImpl.onPostInsert
      1. org.hibernate.envers.event.spi.BaseEnversEventListener.checkIfTransactionInProgress(BaseEnversEventListener.java:132)
      2. org.hibernate.envers.event.spi.EnversPostInsertEventListenerImpl.onPostInsert(EnversPostInsertEventListenerImpl.java:34)
      2 frames
    3. Hibernate
      SessionImpl.saveOrUpdate
      1. org.hibernate.action.internal.EntityIdentityInsertAction.postInsert(EntityIdentityInsertAction.java:156)
      2. org.hibernate.action.internal.EntityIdentityInsertAction.execute(EntityIdentityInsertAction.java:102)
      3. org.hibernate.engine.spi.ActionQueue.execute(ActionQueue.java:597)
      4. org.hibernate.engine.spi.ActionQueue.addResolvedEntityInsertAction(ActionQueue.java:232)
      5. org.hibernate.engine.spi.ActionQueue.addInsertAction(ActionQueue.java:213)
      6. org.hibernate.engine.spi.ActionQueue.addAction(ActionQueue.java:256)
      7. org.hibernate.event.internal.AbstractSaveEventListener.addInsertAction(AbstractSaveEventListener.java:318)
      8. org.hibernate.event.internal.AbstractSaveEventListener.performSaveOrReplicate(AbstractSaveEventListener.java:275)
      9. org.hibernate.event.internal.AbstractSaveEventListener.performSave(AbstractSaveEventListener.java:182)
      10. org.hibernate.event.internal.AbstractSaveEventListener.saveWithGeneratedId(AbstractSaveEventListener.java:113)
      11. org.hibernate.event.internal.DefaultSaveOrUpdateEventListener.saveWithGeneratedOrRequestedId(DefaultSaveOrUpdateEventListener.java:192)
      12. org.hibernate.event.internal.DefaultSaveOrUpdateEventListener.entityIsTransient(DefaultSaveOrUpdateEventListener.java:177)
      13. org.hibernate.event.internal.DefaultSaveOrUpdateEventListener.performSaveOrUpdate(DefaultSaveOrUpdateEventListener.java:97)
      14. org.hibernate.event.internal.DefaultSaveOrUpdateEventListener.onSaveOrUpdate(DefaultSaveOrUpdateEventListener.java:73)
      15. org.hibernate.internal.SessionImpl.fireSaveOrUpdate(SessionImpl.java:651)
      16. org.hibernate.internal.SessionImpl.saveOrUpdate(SessionImpl.java:643)
      17. org.hibernate.internal.SessionImpl.saveOrUpdate(SessionImpl.java:638)
      17 frames