Hi,
I meet an error "Illegal attempt to associate a collection with two open sessions". By searching related mails in this mail list, I find similar problem. However, i still cannot figure out my problem. I track the source code of hibernate, i find the error happens when handling proudcts collection, which has o2r mapping as follows:
<set name="products" table="PI_TMP_CP_BR_PRODUCT" cascade="none">
<key column="BR_OID"/>
<many-to-many column="PRODUCT_ID" class="com.tsmc.pdmcp.basicrecord.CPProduct"/>
</set>
. Could someone help?
Regards,
Rice
2004-06-11 14:03:20,020 [69831] INFO [ExecuteThread: '14' for queue: 'default']
- initialize persistence session
net.sf.hibernate.HibernateException: Illegal attempt to associate a collection w
ith two open sessions
at net.sf.hibernate.collection.PersistentCollection.setCurrentSession(Pe
rsistentCollection.java:262)
at net.sf.hibernate.impl.OnUpdateVisitor.processCollection(OnUpdateVisit
or.java:38)
at net.sf.hibernate.impl.AbstractVisitor.processValue(AbstractVisitor.ja
va:69)
at net.sf.hibernate.impl.AbstractVisitor.processValues(AbstractVisitor.j
ava:36)
at net.sf.hibernate.impl.AbstractVisitor.process(AbstractVisitor.java:93
)
at net.sf.hibernate.impl.SessionImpl.doUpdateMutable(SessionImpl.java:14
26)
at net.sf.hibernate.impl.SessionImpl.doUpdate(SessionImpl.java:1440)
at net.sf.hibernate.impl.SessionImpl.update(SessionImpl.java:1326)
at com.tsmc.pdmcp.persistence.PersistenceManager.change(PersistenceManag
er.java:169)
at com.tsmc.pdmcp.basicrecord.CPBasicRecordManager.changeCPBasicRecord(C
PBasicRecordManager.java:67)
at com.tsmc.pdmcp.usecase.basicrecord.CPBasicRecordUseCase.saveCPBasicRe
cord(CPBasicRecordUseCase.java:257)
at com.tsmc.pdmcp.usecase.basicrecord.CPBasicRecordUseCase.doOperation(C
PBasicRecordUseCase.java:78)
at com.tsmc.pdmcp.ejb.PDMCPSessionBean.doUseCase(PDMCPSessionBean.java:5
0)
at com.tsmc.pdmcp.ejb.PDMCPSessionBean_70supp_EOImpl.doUseCase(PDMCPSess
ionBean_70supp_EOImpl.java:37)
at com.tsmc.pdmcp.ejb.PDMCPSessionBean_70supp_EOImpl_WLSkel.invoke(Unkno
wn Source)
at weblogic.rmi.internal.BasicServerRef.invoke(BasicServerRef.java:296)
at weblogic.rmi.internal.BasicServerRef.handleRequest(BasicServerRef.jav
a:265)
at weblogic.rmi.internal.BasicExecuteRequest.execute(BasicExecuteRequest
.java:22)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:139)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)
2004-06-11 14:03:20,170 [69981] ERROR [ExecuteThread: '14' for queue: 'default']
- com.tsmc.pdmcp.persistence.PersistenceException: net.sf.hibernate.HibernateEx
ception: Illegal attempt to associate a collection with two open sessions
2004-06-11 14:03:20,180 [69991] INFO [ExecuteThread: '14' for queue: 'default']
- closing persistence session
|