0 Replies Latest reply on Sep 8, 2014 2:50 AM by kumar k

    Hibernate - Jboss7 issue

    kumar k Newbie


      Hi ,

       

      We are doing upgradation from Jboss 4 to Jboss 7.1.1.

       

      We are getting the below exception we accessing the application.

       

      Caused by: org.hibernate.HibernateException: Illegal attempt to associate a collection with two open sessions

      at org.hibernate.collection.AbstractPersistentCollection.setCurrentSession(AbstractPersistentCollection.java:410) [hibernate-3.2.7.ga.jar:3.2.7.ga]

      at org.hibernate.event.def.WrapVisitor.processCollection(WrapVisitor.java:44) [hibernate-3.2.7.ga.jar:3.2.7.ga]

      at org.hibernate.event.def.AbstractVisitor.processValue(AbstractVisitor.java:101) [hibernate-3.2.7.ga.jar:3.2.7.ga]

      at org.hibernate.event.def.WrapVisitor.processValue(WrapVisitor.java:98) [hibernate-3.2.7.ga.jar:3.2.7.ga]

      at org.hibernate.event.def.AbstractVisitor.processEntityPropertyValues(AbstractVisitor.java:55) [hibernate-3.2.7.ga.jar:3.2.7.ga]

      at org.hibernate.event.def.AbstractSaveEventListener.visitCollectionsBeforeSave(AbstractSaveEventListener.java:371) [hibernate-3.2.7.ga.jar:3.2.7.ga]

      at org.hibernate.event.def.AbstractSaveEventListener.performSaveOrReplicate(AbstractSaveEventListener.java:273) [hibernate-3.2.7.ga.jar:3.2.7.ga]

      at org.hibernate.event.def.AbstractSaveEventListener.performSave(AbstractSaveEventListener.java:181) [hibernate-3.2.7.ga.jar:3.2.7.ga]

      at org.hibernate.event.def.AbstractSaveEventListener.saveWithGeneratedId(AbstractSaveEventListener.java:121) [hibernate-3.2.7.ga.jar:3.2.7.ga]

      at org.hibernate.ejb.event.EJB3PersistEventListener.saveWithGeneratedId(EJB3PersistEventListener.java:49) [hibernate-entitymanager-3.3.2.GA.jar:3.3.2.GA]

      at org.hibernate.event.def.DefaultPersistEventListener.entityIsTransient(DefaultPersistEventListener.java:131) [hibernate-3.2.7.ga.jar:3.2.7.ga]

      at org.hibernate.event.def.DefaultPersistEventListener.onPersist(DefaultPersistEventListener.java:87) [hibernate-3.2.7.ga.jar:3.2.7.ga]

      at org.hibernate.impl.SessionImpl.firePersist(SessionImpl.java:610) [hibernate-3.2.7.ga.jar:3.2.7.ga]

      at org.hibernate.impl.SessionImpl.persist(SessionImpl.java:602) [hibernate-3.2.7.ga.jar:3.2.7.ga]

      at org.hibernate.engine.EJB3CascadingAction$1.cascade(EJB3CascadingAction.java:30) [hibernate-entitymanager-3.3.2.GA.jar:3.2.7.ga]

      at org.hibernate.engine.Cascade.cascadeToOne(Cascade.java:269) [hibernate-3.2.7.ga.jar:3.2.7.ga]

      at org.hibernate.engine.Cascade.cascadeAssociation(Cascade.java:217) [hibernate-3.2.7.ga.jar:3.2.7.ga]

      at org.hibernate.engine.Cascade.cascadeProperty(Cascade.java:170) [hibernate-3.2.7.ga.jar:3.2.7.ga]

      at org.hibernate.engine.Cascade.cascade(Cascade.java:131) [hibernate-3.2.7.ga.jar:3.2.7.ga]

      at org.hibernate.event.def.AbstractSaveEventListener.cascadeBeforeSave(AbstractSaveEventListener.java:431) [hibernate-3.2.7.ga.jar:3.2.7.ga]

      at org.hibernate.event.def.AbstractSaveEventListener.performSaveOrReplicate(AbstractSaveEventListener.java:265) [hibernate-3.2.7.ga.jar:3.2.7.ga]

      at org.hibernate.event.def.AbstractSaveEventListener.performSave(AbstractSaveEventListener.java:181) [hibernate-3.2.7.ga.jar:3.2.7.ga]

      at org.hibernate.event.def.AbstractSaveEventListener.saveWithGeneratedId(AbstractSaveEventListener.java:107) [hibernate-3.2.7.ga.jar:3.2.7.ga]

      at org.hibernate.ejb.event.EJB3PersistEventListener.saveWithGeneratedId(EJB3PersistEventListener.java:49) [hibernate-entitymanager-3.3.2.GA.jar:3.3.2.GA]

      at org.hibernate.event.def.DefaultPersistEventListener.entityIsTransient(DefaultPersistEventListener.java:131) [hibernate-3.2.7.ga.jar:3.2.7.ga]

      at org.hibernate.event.def.DefaultPersistEventListener.onPersist(DefaultPersistEventListener.java:87) [hibernate-3.2.7.ga.jar:3.2.7.ga]

      at org.hibernate.event.def.DefaultPersistEventListener.onPersist(DefaultPersistEventListener.java:38) [hibernate-3.2.7.ga.jar:3.2.7.ga]

      at org.hibernate.impl.SessionImpl.firePersist(SessionImpl.java:619) [hibernate-3.2.7.ga.jar:3.2.7.ga]

      at org.hibernate.impl.SessionImpl.persist(SessionImpl.java:593) [hibernate-3.2.7.ga.jar:3.2.7.ga]

      at org.hibernate.impl.SessionImpl.persist(SessionImpl.java:597) [hibernate-3.2.7.ga.jar:3.2.7.ga]

      at org.hibernate.ejb.AbstractEntityManagerImpl.persist(AbstractEntityManagerImpl.java:220) [hibernate-entitymanager-3.3.2.GA.jar:3.3.2.GA]

       

      Could you please advise!