我正在使用JPA,Hibernate,Jboss和容器管理的事务。当我试图用数据保存我的大实体时,它会引发异常。将我的实体视为图形模型。每次都不会抛出此异常。
ERROR [org.jboss.ejb3.tx2.impl.CMTTxInterceptor] (WorkerThread#0[127.0.0.1:53478]) javax.ejb.EJBTransactionRolledbackException: Unexpected Error
2014-11-07 13:40:06,332 INFO [org.jboss.resource.connectionmanager.CachedConnectionManager] (WorkerThread#0[127.0.0.1:53478]) Closing a connection for you. Please close them yourself: org.jboss.resource.adapter.jdbc.jdk6.WrappedConnectionJDK6@1261dfa: java.lang.Throwable: STACKTRACE
at org.jboss.resource.connectionmanager.CachedConnectionManager.registerConnection(CachedConnectionManager.java:278) [:6.0.0.Final]
at org.jboss.resource.connectionmanager.BaseConnectionManager2.allocateConnection(BaseConnectionManager2.java:524) [:6.0.0.Final]
at org.jboss.resource.connectionmanager.BaseConnectionManager2$ConnectionManagerProxy.allocateConnection(BaseConnectionManager2.java:941) [:6.0.0.Final]
at org.jboss.resource.adapter.jdbc.WrapperDataSource.getConnection(WrapperDataSource.java:89) [:6.0.0.Final]
at org.hibernate.ejb.connection.InjectedDataSourceConnectionProvider.getConnection(InjectedDataSourceConnectionProvider.java:71) [:3.6.0.Final]
at org.hibernate.jdbc.ConnectionManager.openConnection(ConnectionManager.java:446) [:3.6.0.Final]
at org.hibernate.jdbc.ConnectionManager.getConnection(ConnectionManager.java:167) [:3.6.0.Final]
at org.hibernate.jdbc.AbstractBatcher.prepareStatement(AbstractBatcher.java:116) [:3.6.0.Final]
at org.hibernate.id.IdentityGenerator$GetGeneratedKeysDelegate.prepare(IdentityGenerator.java:90) [:3.6.0.Final]
at org.hibernate.id.insert.AbstractReturningDelegate.performInsert(AbstractReturningDelegate.java:54) [:3.6.0.Final]
at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2327) [:3.6.0.Final]
at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2834) [:3.6.0.Final]
at org.hibernate.action.EntityIdentityInsertAction.execute(EntityIdentityInsertAction.java:71) [:3.6.0.Final]
at org.hibernate.engine.ActionQueue.execute(ActionQueue.java:273) [:3.6.0.Final]
at org.hibernate.event.def.AbstractSaveEventListener.performSaveOrReplicate(AbstractSaveEventListener.java:320) [:3.6.0.Final]
at org.hibernate.event.def.AbstractSaveEventListener.performSave(AbstractSaveEventListener.java:203) [:3.6.0.Final]
at org.hibernate.event.def.AbstractSaveEventListener.saveWithGeneratedId(AbstractSaveEventListener.java:129) [:3.6.0.Final]
at org.hibernate.ejb.event.EJB3PersistEventListener.saveWithGeneratedId(EJB3PersistEventListener.java:69) [:3.6.0.Final]
at org.hibernate.event.def.DefaultPersistEventListener.entityIsTransient(DefaultPersistEventListener.java:179) [:3.6.0.Final]
at org.hibernate.event.def.DefaultPersistEventListener.onPersist(DefaultPersistEventListener.java:135) [:3.6.0.Final]
at org.hibernate.impl.SessionImpl.firePersistOnFlush(SessionImpl.java:834) [:3.6.0.Final]
at org.hibernate.impl.SessionImpl.persistOnFlush(SessionImpl.java:826) [:3.6.0.Final]
at org.hibernate.engine.CascadingAction$9.cascade(CascadingAction.java:357) [:3.6.0.Final]
at org.hibernate.engine.Cascade.cascadeToOne(Cascade.java:392) [:3.6.0.Final]
at org.hibernate.engine.Cascade.cascadeAssociation(Cascade.java:335) [:3.6.0.Final]
at org.hibernate.engine.Cascade.cascadeProperty(Cascade.java:204) [:3.6.0.Final]
at org.hibernate.engine.Cascade.cascadeCollectionElements(Cascade.java:425) [:3.6.0.Final]
at org.hibernate.engine.Cascade.cascadeCollection(Cascade.java:362) [:3.6.0.Final]
at org.hibernate.engine.Cascade.cascadeAssociation(Cascade.java:338) [:3.6.0.Final]
at org.hibernate.engine.Cascade.cascadeProperty(Cascade.java:204) [:3.6.0.Final]
at org.hibernate.engine.Cascade.cascade(Cascade.java:161) [:3.6.0.Final]
at org.hibernate.event.def.AbstractSaveEventListener.cascadeAfterSave(AbstractSaveEventListener.java:475) [:3.6.0.Final]
at org.hibernate.event.def.AbstractSaveEventListener.performSaveOrReplicate(AbstractSaveEventListener.java:353) [:3.6.0.Final]
at org.hibernate.event.def.AbstractSaveEventListener.performSave(AbstractSaveEventListener.java:203) [:3.6.0.Final]
at org.hibernate.event.def.AbstractSaveEventListener.saveWithGeneratedId(AbstractSaveEventListener.java:129) [:3.6.0.Final]
at org.hibernate.ejb.event.EJB3PersistEventListener.saveWithGeneratedId(EJB3PersistEventListener.java:69) [:3.6.0.Final]
at org.hibernate.event.def.DefaultPersistEventListener.entityIsTransient(DefaultPersistEventListener.java:179) [:3.6.0.Final]
at org.hibernate.event.def.DefaultPersistEventListener.onPersist(DefaultPersistEventListener.java:135) [:3.6.0.Final]
at org.hibernate.impl.SessionImpl.firePersistOnFlush(SessionImpl.java:834) [:3.6.0.Final]
at org.hibernate.impl.SessionImpl.persistOnFlush(SessionImpl.java:826) [:3.6.0.Final]
at org.hibernate.engine.CascadingAction$9.cascade(CascadingAction.java:357) [:3.6.0.Final]
at org.hibernate.engine.Cascade.cascadeToOne(Cascade.java:392) [:3.6.0.Final]
at org.hibernate.engine.Cascade.cascadeAssociation(Cascade.java:335) [:3.6.0.Final]
at org.hibernate.engine.Cascade.cascadeProperty(Cascade.java:204) [:3.6.0.Final]
at org.hibernate.engine.Cascade.cascade(Cascade.java:161) [:3.6.0.Final]
at org.hibernate.event.def.AbstractSaveEventListener.cascadeAfterSave(AbstractSaveEventListener.java:475) [:3.6.0.Final]
at org.hibernate.event.def.AbstractSaveEventListener.performSaveOrReplicate(AbstractSaveEventListener.java:353) [:3.6.0.Final]
at org.hibernate.event.def.AbstractSaveEventListener.performSave(AbstractSaveEventListener.java:203) [:3.6.0.Final]
at org.hibernate.event.def.AbstractSaveEventListener.saveWithGeneratedId(AbstractSaveEventListener.java:143) [:3.6.0.Final]
at org.hibernate.ejb.event.EJB3PersistEventListener.saveWithGeneratedId(EJB3PersistEventListener.java:69) [:3.6.0.Final]
at org.hibernate.event.def.DefaultPersistEventListener.entityIsTransient(DefaultPersistEventListener.java:179) [:3.6.0.Final]
at org.hibernate.event.def.DefaultPersistEventListener.onPersist(DefaultPersistEventListener.java:135) [:3.6.0.Final]
at org.hibernate.impl.SessionImpl.firePersistOnFlush(SessionImpl.java:834) [:3.6.0.Final]
at org.hibernate.impl.SessionImpl.persistOnFlush(SessionImpl.java:826) [:3.6.0.Final]
at org.hibernate.engine.CascadingAction$9.cascade(CascadingAction.java:357) [:3.6.0.Final]
at org.hibernate.engine.Cascade.cascadeToOne(Cascade.java:392) [:3.6.0.Final]
at org.hibernate.engine.Cascade.cascadeAssociation(Cascade.java:335) [:3.6.0.Final]
at org.hibernate.engine.Cascade.cascadeProperty(Cascade.java:204) [:3.6.0.Final]
at org.hibernate.engine.Cascade.cascadeCollectionElements(Cascade.java:425) [:3.6.0.Final]
at org.hibernate.engine.Cascade.cascadeCollection(Cascade.java:362) [:3.6.0.Final]
at org.hibernate.engine.Cascade.cascadeAssociation(Cascade.java:338) [:3.6.0.Final]
at org.hibernate.engine.Cascade.cascadeProperty(Cascade.java:204) [:3.6.0.Final]
at org.hibernate.engine.Cascade.cascade(Cascade.java:161) [:3.6.0.Final]
at org.hibernate.event.def.AbstractSaveEventListener.cascadeAfterSave(AbstractSaveEventListener.java:475) [:3.6.0.Final]
at org.hibernate.event.def.DefaultPersistEventListener.entityIsPersistent(DefaultPersistEventListener.java:159) [:3.6.0.Final]
at org.hibernate.event.def.DefaultPersistEventListener.onPersist(DefaultPersistEventListener.java:132) [:3.6.0.Final]
at org.hibernate.impl.SessionImpl.firePersistOnFlush(SessionImpl.java:834) [:3.6.0.Final]
at org.hibernate.impl.SessionImpl.persistOnFlush(SessionImpl.java:826) [:3.6.0.Final]
at org.hibernate.engine.CascadingAction$9.cascade(CascadingAction.java:357) [:3.6.0.Final]
at org.hibernate.engine.Cascade.cascadeToOne(Cascade.java:392) [:3.6.0.Final]
at org.hibernate.engine.Cascade.cascadeAssociation(Cascade.java:335) [:3.6.0.Final]
at org.hibernate.engine.Cascade.cascadeProperty(Cascade.java:204) [:3.6.0.Final]
at org.hibernate.engine.Cascade.cascadeCollectionElements(Cascade.java:425) [:3.6.0.Final]
at org.hibernate.engine.Cascade.cascadeCollection(Cascade.java:362) [:3.6.0.Final]
at org.hibernate.engine.Cascade.cascadeAssociation(Cascade.java:338) [:3.6.0.Final]
at org.hibernate.engine.Cascade.cascadeProperty(Cascade.java:204) [:3.6.0.Final]
at org.hibernate.engine.Cascade.cascade(Cascade.java:161) [:3.6.0.Final]
at org.hibernate.event.def.AbstractSaveEventListener.cascadeAfterSave(AbstractSaveEventListener.java:475) [:3.6.0.Final]
at org.hibernate.event.def.AbstractSaveEventListener.performSaveOrReplicate(AbstractSaveEventListener.java:353) [:3.6.0.Final]
at org.hibernate.event.def.AbstractSaveEventListener.performSave(AbstractSaveEventListener.java:203) [:3.6.0.Final]
at org.hibernate.event.def.AbstractSaveEventListener.saveWithGeneratedId(AbstractSaveEventListener.java:129) [:3.6.0.Final]
at org.hibernate.ejb.event.EJB3PersistEventListener.saveWithGeneratedId(EJB3PersistEventListener.java:69) [:3.6.0.Final]
at org.hibernate.event.def.DefaultPersistEventListener.entityIsTransient(DefaultPersistEventListener.java:179) [:3.6.0.Final]
at org.hibernate.event.def.DefaultPersistEventListener.onPersist(DefaultPersistEventListener.java:135) [:3.6.0.Final]
at org.hibernate.impl.SessionImpl.firePersistOnFlush(SessionImpl.java:834) [:3.6.0.Final]
at org.hibernate.impl.SessionImpl.persistOnFlush(SessionImpl.java:826) [:3.6.0.Final]
at org.hibernate.engine.CascadingAction$9.cascade(CascadingAction.java:357) [:3.6.0.Final]
at org.hibernate.engine.Cascade.cascadeToOne(Cascade.java:392) [:3.6.0.Final]
at org.hibernate.engine.Cascade.cascadeAssociation(Cascade.java:335) [:3.6.0.Final]
at org.hibernate.engine.Cascade.cascadeProperty(Cascade.java:204) [:3.6.0.Final]
at org.hibernate.engine.Cascade.cascade(Cascade.java:161) [:3.6.0.Final]
at org.hibernate.event.def.AbstractSaveEventListener.cascadeBeforeSave(AbstractSaveEventListener.java:450) [:3.6.0.Final]
at org.hibernate.event.def.AbstractSaveEventListener.performSaveOrReplicate(AbstractSaveEventListener.java:282) [:3.6.0.Final]
at org.hibernate.event.def.AbstractSaveEventListener.performSave(AbstractSaveEventListener.java:203) [:3.6.0.Final]
at org.hibernate.event.def.AbstractSaveEventListener.saveWithGeneratedId(AbstractSaveEventListener.java:143) [:3.6.0.Final]
at org.hibernate.ejb.event.EJB3PersistEventListener.saveWithGeneratedId(EJB3PersistEventListener.java:69) [:3.6.0.Final]
at org.hibernate.event.def.DefaultPersistEventListener.entityIsTransient(DefaultPersistEventListener.java:179) [:3.6.0.Final]
at org.hibernate.event.def.DefaultPersistEventListener.onPersist(DefaultPersistEventListener.java:135) [:3.6.0.Final]
at org.hibernate.impl.SessionImpl.firePersistOnFlush(SessionImpl.java:834) [:3.6.0.Final]
at org.hibernate.impl.SessionImpl.persistOnFlush(SessionImpl.java:826) [:3.6.0.Final]
at org.hibernate.engine.CascadingAction$9.cascade(CascadingAction.java:357) [:3.6.0.Final]
at org.hibernate.engine.Cascade.cascadeToOne(Cascade.java:392) [:3.6.0.Final]
at org.hibernate.engine.Cascade.cascadeAssociation(Cascade.java:335) [:3.6.0.Final]
at org.hibernate.engine.Cascade.cascadeProperty(Cascade.java:204) [:3.6.0.Final]
at org.hibernate.engine.Cascade.cascadeCollectionElements(Cascade.java:425) [:3.6.0.Final]
at org.hibernate.engine.Cascade.cascadeCollection(Cascade.java:362) [:3.6.0.Final]
at org.hibernate.engine.Cascade.cascadeAssociation(Cascade.java:338) [:3.6.0.Final]
at org.hibernate.engine.Cascade.cascadeProperty(Cascade.java:204) [:3.6.0.Final]
at org.hibernate.engine.Cascade.cascade(Cascade.java:161) [:3.6.0.Final]
at org.hibernate.event.def.AbstractSaveEventListener.cascadeAfterSave(AbstractSaveEventListener.java:475) [:3.6.0.Final]
at org.hibernate.event.def.DefaultPersistEventListener.entityIsPersistent(DefaultPersistEventListener.java:159) [:3.6.0.Final]
at org.hibernate.event.def.DefaultPersistEventListener.onPersist(DefaultPersistEventListener.java:132) [:3.6.0.Final]
at org.hibernate.impl.SessionImpl.firePersistOnFlush(SessionImpl.java:834) [:3.6.0.Final]
at org.hibernate.impl.SessionImpl.persistOnFlush(SessionImpl.java:826) [:3.6.0.Final]
at org.hibernate.engine.CascadingAction$9.cascade(CascadingAction.java:357) [:3.6.0.Final]
at org.hibernate.engine.Cascade.cascadeToOne(Cascade.java:392) [:3.6.0.Final]
at org.hibernate.engine.Cascade.cascadeAssociation(Cascade.java:335) [:3.6.0.Final]
at org.hibernate.engine.Cascade.cascadeProperty(Cascade.java:204) [:3.6.0.Final]
at org.hibernate.engine.Cascade.cascadeCollectionElements(Cascade.java:425) [:3.6.0.Final]
at org.hibernate.engine.Cascade.cascadeCollection(Cascade.java:362) [:3.6.0.Final]
at org.hibernate.engine.Cascade.cascadeAssociation(Cascade.java:338) [:3.6.0.Final]
at org.hibernate.engine.Cascade.cascadeProperty(Cascade.java:204) [:3.6.0.Final]
at org.hibernate.engine.Cascade.cascade(Cascade.java:161) [:3.6.0.Final]
at org.hibernate.event.def.AbstractSaveEventListener.cascadeAfterSave(AbstractSaveEventListener.java:475) [:3.6.0.Final]
at org.hibernate.event.def.AbstractSaveEventListener.performSaveOrReplicate(AbstractSaveEventListener.java:353) [:3.6.0.Final]
at org.hibernate.event.def.AbstractSaveEventListener.performSave(AbstractSaveEventListener.java:203) [:3.6.0.Final]
at org.hibernate.event.def.AbstractSaveEventListener.saveWithGeneratedId(AbstractSaveEventListener.java:129) [:3.6.0.Final]
at org.hibernate.ejb.event.EJB3PersistEventListener.saveWithGeneratedId(EJB3PersistEventListener.java:69) [:3.6.0.Final]
at org.hibernate.event.def.DefaultPersistEventListener.entityIsTransient(DefaultPersistEventListener.java:179) [:3.6.0.Final]
at org.hibernate.event.def.DefaultPersistEventListener.onPersist(DefaultPersistEventListener.java:135) [:3.6.0.Final]
at org.hibernate.impl.SessionImpl.firePersistOnFlush(SessionImpl.java:834) [:3.6.0.Final]
at org.hibernate.impl.SessionImpl.persistOnFlush(SessionImpl.java:826) [:3.6.0.Final]
at org.hibernate.engine.CascadingAction$9.cascade(CascadingAction.java:357) [:3.6.0.Final]
at org.hibernate.engine.Cascade.cascadeToOne(Cascade.java:392) [:3.6.0.Final]
at org.hibernate.engine.Cascade.cascadeAssociation(Cascade.java:335) [:3.6.0.Final]
at org.hibernate.engine.Cascade.cascadeProperty(Cascade.java:204) [:3.6.0.Final]
at org.hibernate.engine.Cascade.cascadeCollectionElements(Cascade.java:425) [:3.6.0.Final]
at org.hibernate.engine.Cascade.cascadeCollection(Cascade.java:362) [:3.6.0.Final]
at org.hibernate.engine.Cascade.cascadeAssociation(Cascade.java:338) [:3.6.0.Final]
at org.hibernate.engine.Cascade.cascadeProperty(Cascade.java:204) [:3.6.0.Final]
at org.hibernate.engine.Cascade.cascade(Cascade.java:161) [:3.6.0.Final]
at org.hibernate.event.def.AbstractSaveEventListener.cascadeAfterSave(AbstractSaveEventListener.java:475) [:3.6.0.Final]
at org.hibernate.event.def.DefaultPersistEventListener.entityIsPersistent(DefaultPersistEventListener.java:159) [:3.6.0.Final]
at org.hibernate.event.def.DefaultPersistEventListener.onPersist(DefaultPersistEventListener.java:132) [:3.6.0.Final]
at org.hibernate.impl.SessionImpl.firePersistOnFlush(SessionImpl.java:834) [:3.6.0.Final]
at org.hibernate.impl.SessionImpl.persistOnFlush(SessionImpl.java:826) [:3.6.0.Final]
at org.hibernate.engine.CascadingAction$9.cascade(CascadingAction.java:357) [:3.6.0.Final]
at org.hibernate.engine.Cascade.cascadeToOne(Cascade.java:392) [:3.6.0.Final]
at org.hibernate.engine.Cascade.cascadeAssociation(Cascade.java:335) [:3.6.0.Final]
at org.hibernate.engine.Cascade.cascadeProperty(Cascade.java:204) [:3.6.0.Final]
at org.hibernate.engine.Cascade.cascadeCollectionElements(Cascade.java:425) [:3.6.0.Final]
at org.hibernate.engine.Cascade.cascadeCollection(Cascade.java:362) [:3.6.0.Final]
at org.hibernate.engine.Cascade.cascadeAssociation(Cascade.java:338) [:3.6.0.Final]
at org.hibernate.engine.Cascade.cascadeProperty(Cascade.java:204) [:3.6.0.Final]
at org.hibernate.engine.Cascade.cascade(Cascade.java:161) [:3.6.0.Final]
at org.hibernate.event.def.AbstractSaveEventListener.cascadeAfterSave(AbstractSaveEventListener.java:475) [:3.6.0.Final]
at org.hibernate.event.def.AbstractSaveEventListener.performSaveOrReplicate(AbstractSaveEventListener.java:353) [:3.6.0.Final]
at org.hibernate.event.def.AbstractSaveEventListener.performSave(AbstractSaveEventListener.java:203) [:3.6.0.Final]
at org.hibernate.event.def.AbstractSaveEventListener.saveWithGeneratedId(AbstractSaveEventListener.java:129) [:3.6.0.Final]
at org.hibernate.ejb.event.EJB3PersistEventListener.saveWithGeneratedId(EJB3PersistEventListener.java:69) [:3.6.0.Final]
at org.hibernate.event.def.DefaultPersistEventListener.entityIsTransient(DefaultPersistEventListener.java:179) [:3.6.0.Final]
at org.hibernate.event.def.DefaultPersistEventListener.onPersist(DefaultPersistEventListener.java:135) [:3.6.0.Final]
at org.hibernate.impl.SessionImpl.firePersistOnFlush(SessionImpl.java:834) [:3.6.0.Final]
at org.hibernate.impl.SessionImpl.persistOnFlush(SessionImpl.java:826) [:3.6.0.Final]
at org.hibernate.engine.CascadingAction$9.cascade(CascadingAction.java:357) [:3.6.0.Final]
at org.hibernate.engine.Cascade.cascadeToOne(Cascade.java:392) [:3.6.0.Final]
at org.hibernate.engine.Cascade.cascadeAssociation(Cascade.java:335) [:3.6.0.Final]
at org.hibernate.engine.Cascade.cascadeProperty(Cascade.java:204) [:3.6.0.Final]
at org.hibernate.engine.Cascade.cascade(Cascade.java:161) [:3.6.0.Final]
at org.hibernate.event.def.AbstractSaveEventListener.cascadeBeforeSave(AbstractSaveEventListener.java:450) [:3.6.0.Final]
at org.hibernate.event.def.AbstractSaveEventListener.performSaveOrReplicate(AbstractSaveEventListener.java:282) [:3.6.0.Final]
at org.hibernate.event.def.AbstractSaveEventListener.performSave(AbstractSaveEventListener.java:203) [:3.6.0.Final]
at org.hibernate.event.def.AbstractSaveEventListener.saveWithGeneratedId(AbstractSaveEventListener.java:143) [:3.6.0.Final]
at org.hibernate.ejb.event.EJB3PersistEventListener.saveWithGeneratedId(EJB3PersistEventListener.java:69) [:3.6.0.Final]
at org.hibernate.event.def.DefaultPersistEventListener.entityIsTransient(DefaultPersistEventListener.java:179) [:3.6.0.Final]
at org.hibernate.event.def.DefaultPersistEventListener.onPersist(DefaultPersistEventListener.java:135) [:3.6.0.Final]
at org.hibernate.impl.SessionImpl.firePersistOnFlush(SessionImpl.java:834) [:3.6.0.Final]
at org.hibernate.impl.SessionImpl.persistOnFlush(SessionImpl.java:826) [:3.6.0.Final]
at org.hibernate.engine.CascadingAction$9.cascade(CascadingAction.java:357) [:3.6.0.Final]
at org.hibernate.engine.Cascade.cascadeToOne(Cascade.java:392) [:3.6.0.Final]
at org.hibernate.engine.Cascade.cascadeAssociation(Cascade.java:335) [:3.6.0.Final]
at org.hibernate.engine.Cascade.cascadeProperty(Cascade.java:204) [:3.6.0.Final]
at org.hibernate.engine.Cascade.cascadeCollectionElements(Cascade.java:425) [:3.6.0.Final]
at org.hibernate.engine.Cascade.cascadeCollection(Cascade.java:362) [:3.6.0.Final]
at org.hibernate.engine.Cascade.cascadeAssociation(Cascade.java:338) [:3.6.0.Final]
at org.hibernate.engine.Cascade.cascadeProperty(Cascade.java:204) [:3.6.0.Final]
at org.hibernate.engine.Cascade.cascade(Cascade.java:161) [:3.6.0.Final]
at org.hibernate.event.def.AbstractSaveEventListener.cascadeAfterSave(AbstractSaveEventListener.java:475) [:3.6.0.Final]
at org.hibernate.event.def.DefaultPersistEventListener.entityIsPersistent(DefaultPersistEventListener.java:159) [:3.6.0.Final]
at org.hibernate.event.def.DefaultPersistEventListener.onPersist(DefaultPersistEventListener.java:132) [:3.6.0.Final]
at org.hibernate.impl.SessionImpl.firePersistOnFlush(SessionImpl.java:834) [:3.6.0.Final]
at org.hibernate.impl.SessionImpl.persistOnFlush(SessionImpl.java:826) [:3.6.0.Final]
at org.hibernate.engine.CascadingAction$9.cascade(CascadingAction.java:357) [:3.6.0.Final]
at org.hibernate.engine.Cascade.cascadeToOne(Cascade.java:392) [:3.6.0.Final]
at org.hibernate.engine.Cascade.cascadeAssociation(Cascade.java:335) [:3.6.0.Final]
at org.hibernate.engine.Cascade.cascadeProperty(Cascade.java:204) [:3.6.0.Final]
at org.hibernate.engine.Cascade.cascadeCollectionElements(Cascade.java:425) [:3.6.0.Final]
at org.hibernate.engine.Cascade.cascadeCollection(Cascade.java:362) [:3.6.0.Final]
at org.hibernate.engine.Cascade.cascadeAssociation(Cascade.java:338) [:3.6.0.Final]
at org.hibernate.engine.Cascade.cascadeProperty(Cascade.java:204) [:3.6.0.Final]
at org.hibernate.engine.Cascade.cascade(Cascade.java:161) [:3.6.0.Final]
at org.hibernate.event.def.AbstractSaveEventListener.cascadeAfterSave(AbstractSaveEventListener.java:475) [:3.6.0.Final]
at org.hibernate.event.def.AbstractSaveEventListener.performSaveOrReplicate(AbstractSaveEventListener.java:353) [:3.6.0.Final]
at org.hibernate.event.def.AbstractSaveEventListener.performSave(AbstractSaveEventListener.java:203) [:3.6.0.Final]
at org.hibernate.event.def.AbstractSaveEventListener.saveWithGeneratedId(AbstractSaveEventListener.java:129) [:3.6.0.Final]
at org.hibernate.ejb.event.EJB3PersistEventListener.saveWithGeneratedId(EJB3PersistEventListener.java:69) [:3.6.0.Final]
at org.hibernate.event.def.DefaultPersistEventListener.entityIsTransient(DefaultPersistEventListener.java:179) [:3.6.0.Final]
at org.hibernate.event.def.DefaultPersistEventListener.onPersist(DefaultPersistEventListener.java:135) [:3.6.0.Final]
at org.hibernate.impl.SessionImpl.firePersistOnFlush(SessionImpl.java:834) [:3.6.0.Final]
at org.hibernate.impl.SessionImpl.persistOnFlush(SessionImpl.java:826) [:3.6.0.Final]
at org.hibernate.engine.CascadingAction$9.cascade(CascadingAction.java:357) [:3.6.0.Final]
at org.hibernate.engine.Cascade.cascadeToOne(Cascade.java:392) [:3.6.0.Final]
at org.hibernate.engine.Cascade.cascadeAssociation(Cascade.java:335) [:3.6.0.Final]
at org.hibernate.engine.Cascade.cascadeProperty(Cascade.java:204) [:3.6.0.Final]
at org.hibernate.engine.Cascade.cascadeCollectionElements(Cascade.java:425) [:3.6.0.Final]
at org.hibernate.engine.Cascade.cascadeCollection(Cascade.java:362) [:3.6.0.Final]
at org.hibernate.engine.Cascade.cascadeAssociation(Cascade.java:338) [:3.6.0.Final]
at org.hibernate.engine.Cascade.cascadeProperty(Cascade.java:204) [:3.6.0.Final]
at org.hibernate.engine.Cascade.cascade(Cascade.java:161) [:3.6.0.Final]
at org.hibernate.event.def.AbstractSaveEventListener.cascadeAfterSave(AbstractSaveEventListener.java:475) [:3.6.0.Final]
at org.hibernate.event.def.DefaultPersistEventListener.entityIsPersistent(DefaultPersistEventListener.java:159) [:3.6.0.Final]
at org.hibernate.event.def.DefaultPersistEventListener.onPersist(DefaultPersistEventListener.java:132) [:3.6.0.Final]
at org.hibernate.impl.SessionImpl.firePersistOnFlush(SessionImpl.java:834) [:3.6.0.Final]
at org.hibernate.impl.SessionImpl.persistOnFlush(SessionImpl.java:826) [:3.6.0.Final]
at org.hibernate.engine.CascadingAction$9.cascade(CascadingAction.java:357) [:3.6.0.Final]
at org.hibernate.engine.Cascade.cascadeToOne(Cascade.java:392) [:3.6.0.Final]
at org.hibernate.engine.Cascade.cascadeAssociation(Cascade.java:335) [:3.6.0.Final]
at org.hibernate.engine.Cascade.cascadeProperty(Cascade.java:204) [:3.6.0.Final]
at org.hibernate.engine.Cascade.cascadeCollectionElements(Cascade.java:425) [:3.6.0.Final]
at org.hibernate.engine.Cascade.cascadeCollection(Cascade.java:362) [:3.6.0.Final]
at org.hibernate.engine.Cascade.cascadeAssociation(Cascade.java:338) [:3.6.0.Final]
at org.hibernate.engine.Cascade.cascadeProperty(Cascade.java:204) [:3.6.0.Final]
at org.hibernate.engine.Cascade.cascade(Cascade.java:161) [:3.6.0.Final]
at org.hibernate.event.def.AbstractSaveEventListener.cascadeAfterSave(AbstractSaveEventListener.java:475) [:3.6.0.Final]
at org.hibernate.event.def.AbstractSaveEventListener.performSaveOrReplicate(AbstractSaveEventListener.java:353) [:3.6.0.Final]
at org.hibernate.event.def.AbstractSaveEventListener.performSave(AbstractSaveEventListener.java:203) [:3.6.0.Final]
at org.hibernate.event.def.AbstractSaveEventListener.saveWithGeneratedId(AbstractSaveEventListener.java:129) [:3.6.0.Final]
at org.hibernate.ejb.event.EJB3PersistEventListener.saveWithGeneratedId(EJB3PersistEventListener.java:69) [:3.6.0.Final]
at org.hibernate.event.def.DefaultPersistEventListener.entityIsTransient(DefaultPersistEventListener.java:179) [:3.6.0.Final]
at org.hibernate.event.def.DefaultPersistEventListener.onPersist(DefaultPersistEventListener.java:135) [:3.6.0.Final]
at org.hibernate.impl.SessionImpl.firePersistOnFlush(SessionImpl.java:834) [:3.6.0.Final]
at org.hibernate.impl.SessionImpl.persistOnFlush(SessionImpl.java:826) [:3.6.0.Final]
at org.hibernate.engine.CascadingAction$9.cascade(CascadingAction.java:357) [:3.6.0.Final]
at org.hibernate.engine.Cascade.cascadeToOne(Cascade.java:392) [:3.6.0.Final]
at org.hibernate.engine.Cascade.cascadeAssociation(Cascade.java:335) [:3.6.0.Final]
at org.hibernate.engine.Cascade.cascadeProperty(Cascade.java:204) [:3.6.0.Final]
at org.hibernate.engine.Cascade.cascade(Cascade.java:161) [:3.6.0.Final]
at org.hibernate.event.def.AbstractSaveEventListener.cascadeBeforeSave(AbstractSaveEventListener.java:450) [:3.6.0.Final]
at org.hibernate.event.def.AbstractSaveEventListener.performSaveOrReplicate(AbstractSaveEventListener.java:282) [:3.6.0.Final]
at org.hibernate.event.def.AbstractSaveEventListener.performSave(AbstractSaveEventListener.java:203) [:3.6.0.Final]
at org.hibernate.event.def.AbstractSaveEventListener.saveWithGeneratedId(AbstractSaveEventListener.java:143) [:3.6.0.Final]
at org.hibernate.ejb.event.EJB3PersistEventListener.saveWithGeneratedId(EJB3PersistEventListener.java:69) [:3.6.0.Final]
at org.hibernate.event.def.DefaultPersistEventListener.entityIsTransient(DefaultPersistEventListener.java:179) [:3.6.0.Final]
at org.hibernate.event.def.DefaultPersistEventListener.onPersist(DefaultPersistEventListener.java:135) [:3.6.0.Final]
at org.hibernate.impl.SessionImpl.firePersistOnFlush(SessionImpl.java:834) [:3.6.0.Final]
at org.hibernate.impl.SessionImpl.persistOnFlush(SessionImpl.java:826) [:3.6.0.Final]
at org.hibernate.engine.CascadingAction$9.cascade(CascadingAction.java:357) [:3.6.0.Final]
at org.hibernate.engine.Cascade.cascadeToOne(Cascade.java:392) [:3.6.0.Final]
at org.hibernate.engine.Cascade.cascadeAssociation(Cascade.java:335) [:3.6.0.Final]
at org.hibernate.engine.Cascade.cascadeProperty(Cascade.java:204) [:3.6.0.Final]
at org.hibernate.engine.Cascade.cascadeCollectionElements(Cascade.java:425) [:3.6.0.Final]
at org.hibernate.engine.Cascade.cascadeCollection(Cascade.java:362) [:3.6.0.Final]
at org.hibernate.engine.Cascade.cascadeAssociation(Cascade.java:338) [:3.6.0.Final]
at org.hibernate.engine.Cascade.cascadeProperty(Cascade.java:204) [:3.6.0.Final]
at org.hibernate.engine.Cascade.cascade(Cascade.java:161) [:3.6.0.Final]
at org.hibernate.event.def.AbstractSaveEventListener.cascadeAfterSave(AbstractSaveEventListener.java:475) [:3.6.0.Final]
at org.hibernate.event.def.DefaultPersistEventListener.entityIsPersistent(DefaultPersistEventListener.java:159) [:3.6.0.Final]
at org.hibernate.event.def.DefaultPersistEventListener.onPersist(DefaultPersistEventListener.java:132) [:3.6.0.Final]
at org.hibernate.impl.SessionImpl.firePersistOnFlush(SessionImpl.java:834) [:3.6.0.Final]
at org.hibernate.impl.SessionImpl.persistOnFlush(SessionImpl.java:826) [:3.6.0.Final]
at org.hibernate.engine.CascadingAction$9.cascade(CascadingAction.java:357) [:3.6.0.Final]
at org.hibernate.engine.Cascade.cascadeToOne(Cascade.java:392) [:3.6.0.Final]
at org.hibernate.engine.Cascade.cascadeAssociation(Cascade.java:335) [:3.6.0.Final]
at org.hibernate.engine.Cascade.cascadeProperty(Cascade.java:204) [:3.6.0.Final]
at org.hibernate.engine.Cascade.cascadeCollectionElements(Cascade.java:425) [:3.6.0.Final]
at org.hibernate.engine.Cascade.cascadeCollection(Cascade.java:362) [:3.6.0.Final]
at org.hibernate.engine.Cascade.cascadeAssociation(Cascade.java:338) [:3.6.0.Final]
at org.hibernate.engine.Cascade.cascadeProperty(Cascade.java:204) [:3.6.0.Final]
at org.hibernate.engine.Cascade.cascade(Cascade.java:161) [:3.6.0.Final]
at
答案 0 :(得分:0)
这是因为某些数据库连接未显式关闭。这可能是由于Hibernate事务配置不当造成的。
由于你在JBoss上运行,你必须确保Hibernate使用“JTA”并且Hibernate可以找到你的XA数据源:
hibernate.connection.datasource=java:/comp/env/jdbc/datasource
hibernate.transaction.factory_class=org.hibernate.transaction.JTATransactionFactory
hibernate.transaction.manager_lookup_class =org.hibernate.transaction.JBossTransactionManagerLookup
如果问题仍然存在,请检查the following SO question。