• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Stale State Exception in session.save

 
stshiva raaj
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
My hibernate configuration looks recursive map.

Device dev=new Device();
//--- setDevId();

Dummy dum=new Dummy();
dum.setDevice(dev);

dev.setDummy(dum);

sessoin.save(dev);
session.flush();// Getting exception state state object

The db design is,
Device.hbm.xml
==============
Device (1) --- Dummy(M)(Bag)

Dummy.xml
=======
Dummy 1 --- Device 1

My problem is , when i save the pojo i faced this problem. Is there any way to solve this problem?
 
Richard Chesterwood
Virtual Pair Programmers Rep
Greenhorn
Posts: 29
7
Hibernate Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can you show us your full entity code, Device and Dummy? The full XML would be useful also.

Pay particular attention to your management of whichever attribute you're using for an ID. It's easy for Hibernate to think you mean a different row if the ID isn't set correctly.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic