java.lang.IllegalArgumentException: Removing a detached instance com.xxx.em.Edition#282

Hibernate JIRA | Balwinder Sodhi | 9 years ago
tip
Your exception is missing from the Samebug knowledge base.
Here are the best solutions we found on the Internet.
Click on the to mark the helpful solution and get rewards for you help.
  1. 0

    Trying to remove a detached entity fails with the exception given below. Looking into the source code at EJB3DeleteEventListener.java:45 I find that the method (pasted below) *always* throws the exception at line#45 regardless of the event contents. @Override protected void performDetachedEntityDeletionCheck(DeleteEvent event) { EventSource source = event.getSession(); String entityName = event.getEntityName(); EntityPersister persister = source.getEntityPersister( entityName, event.getObject() ); Serializable id = persister.getIdentifier( event.getObject(), source.getEntityMode() ); entityName = entityName == null ? source.guessEntityName( event.getObject() ) : entityName; throw new IllegalArgumentException("Removing a detached instance "+ entityName + "#" + id); } java.lang.IllegalArgumentException: Removing a detached instance com.xxx.em.Edition#282 at org.hibernate.ejb.event.EJB3DeleteEventListener.performDetachedEntityDeletionCheck(EJB3DeleteEventListener.java:45) at org.hibernate.event.def.DefaultDeleteEventListener.onDelete(DefaultDeleteEventListener.java:86) at org.hibernate.event.def.DefaultDeleteEventListener.onDelete(DefaultDeleteEventListener.java:52) at org.hibernate.impl.SessionImpl.fireDelete(SessionImpl.java:766) at org.hibernate.impl.SessionImpl.delete(SessionImpl.java:744) at org.hibernate.ejb.AbstractEntityManagerImpl.remove(AbstractEntityManagerImpl.java:246)

    Hibernate JIRA | 9 years ago | Balwinder Sodhi
    java.lang.IllegalArgumentException: Removing a detached instance com.xxx.em.Edition#282
  2. 0

    Trying to remove a detached entity fails with the exception given below. Looking into the source code at EJB3DeleteEventListener.java:45 I find that the method (pasted below) *always* throws the exception at line#45 regardless of the event contents. @Override protected void performDetachedEntityDeletionCheck(DeleteEvent event) { EventSource source = event.getSession(); String entityName = event.getEntityName(); EntityPersister persister = source.getEntityPersister( entityName, event.getObject() ); Serializable id = persister.getIdentifier( event.getObject(), source.getEntityMode() ); entityName = entityName == null ? source.guessEntityName( event.getObject() ) : entityName; throw new IllegalArgumentException("Removing a detached instance "+ entityName + "#" + id); } java.lang.IllegalArgumentException: Removing a detached instance com.xxx.em.Edition#282 at org.hibernate.ejb.event.EJB3DeleteEventListener.performDetachedEntityDeletionCheck(EJB3DeleteEventListener.java:45) at org.hibernate.event.def.DefaultDeleteEventListener.onDelete(DefaultDeleteEventListener.java:86) at org.hibernate.event.def.DefaultDeleteEventListener.onDelete(DefaultDeleteEventListener.java:52) at org.hibernate.impl.SessionImpl.fireDelete(SessionImpl.java:766) at org.hibernate.impl.SessionImpl.delete(SessionImpl.java:744) at org.hibernate.ejb.AbstractEntityManagerImpl.remove(AbstractEntityManagerImpl.java:246)

    Hibernate JIRA | 9 years ago | Balwinder Sodhi
    java.lang.IllegalArgumentException: Removing a detached instance com.xxx.em.Edition#282
  3. 0

    Removing a detached instance (in job/timer/thread) - Spring Forum

    spring.io | 7 months ago
    java.lang.IllegalArgumentException: Removing a detached instance stu.entities.PlayerStatistic#1
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    Removing a data in database. Detached instance

    Stack Overflow | 3 years ago | The Nightmare
    java.lang.IllegalArgumentException: Removing a detached instance pl.ePrzychodnia.model.PatientCard#1
  6. 0

    Hibernate JPA removing detached object

    Stack Overflow | 3 years ago | Enerccio
    java.lang.IllegalArgumentException: Removing a detached instance FooEntity

    1 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. java.lang.IllegalArgumentException

      Removing a detached instance com.xxx.em.Edition#282

      at org.hibernate.ejb.event.EJB3DeleteEventListener.performDetachedEntityDeletionCheck()
    2. Hibernate EJB
      EJB3DeleteEventListener.performDetachedEntityDeletionCheck
      1. org.hibernate.ejb.event.EJB3DeleteEventListener.performDetachedEntityDeletionCheck(EJB3DeleteEventListener.java:45)
      1 frame
    3. Hibernate
      SessionImpl.delete
      1. org.hibernate.event.def.DefaultDeleteEventListener.onDelete(DefaultDeleteEventListener.java:86)
      2. org.hibernate.event.def.DefaultDeleteEventListener.onDelete(DefaultDeleteEventListener.java:52)
      3. org.hibernate.impl.SessionImpl.fireDelete(SessionImpl.java:766)
      4. org.hibernate.impl.SessionImpl.delete(SessionImpl.java:744)
      4 frames
    4. Hibernate EJB
      AbstractEntityManagerImpl.remove
      1. org.hibernate.ejb.AbstractEntityManagerImpl.remove(AbstractEntityManagerImpl.java:246)
      1 frame