JWorld@TW the best professional Java site in Taiwan
      註冊 | 登入 | 全文檢索 | 排行榜  

» JWorld@TW » Object Relational Mapping » Hibernate  

按列印兼容模式列印這個話題 列印話題    把這個話題寄給朋友 寄給朋友    訂閱主題
reply to postflat modego to previous topicgo to next topic
本主題所含的標籤
無標籤
作者 Re:a different object with the same identifier value was already associated with the session?? [Re:magic]
cw1057





發文: 11
積分: 0
於 2007-03-23 12:38 user profilesend a private message to usersend email to cw1057reply to postreply to postsearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
的確很奇怪~
方不方便借喵一下goodMgr.persistPresent這個method啊?

如果goodMgr.persistPresent裡只是取得session、呼叫update、然後close,理論上不應該出現那個錯誤。
除非在goodMgr.persistPresent裡做了其他事,像是用g.getId()去取出舊物件做log或資料正確性檢查之類的,就會出現那種情形,這是我以前遇到的情況,這時就得用evict將舊物件踢出session才能update detached object。
但是『如果我把那一行查詢 GoodCategory 的程式拿掉,persist 就可以正常進行』,這樣看來,會不會你的session沒有關掉啊,整個controller都用同一個session(session over conversation)


reply to postreply to post
話題樹型展開
人氣 標題 作者 字數 發文時間
8463 a different object with the same identifier value was already associated with the session?? magic 1512 2007-03-22 21:51
6310 Re:a different object with the same identifier value was already associated with the session?? cw1057 368 2007-03-23 12:38
6412 Re:a different object with the same identifier value was already associated with the session?? magic 1316 2007-03-24 00:11
» JWorld@TW »  Object Relational Mapping » Hibernate

reply to postflat modego to previous topicgo to next topic
  已讀文章
  新的文章
  被刪除的文章
Jump to the top of page

JWorld@TW 本站商標資訊

Powered by Powerful JuteForum® Version Jute 1.5.8