Possible Duplicate:
Hibernate: different object with the same identifier value was already associated with the session
I tried to save two entity once:
session=....getCurrentSession();
Book bo1=new Book();
bo1.setName("name1");
session.save(bo1);
Book bo2=new Book();
bo2.setName("name2");
session.save(bo2);
Then I get a exception:
a different object with the same identifier value was already associated with the session.
Seems that the bo2' identifier exist (the bo1's identifier), I wonder why?
BTW, I really want to know more about the session in hibernate, any docs? I have read the tutorial of hibernate, but it is not detailed enough.