What happens with Entities in session if I make rollback ? Do they get back to the state before transaction ? In particular do they get new ids ?
Example:
session.startTransaction();
Entity e = new Entity(); //e.id == null
session.save (e); //suppose it was ok
session.rollback(); // e.id == ???
Update:
I've made the Hibernate 4 test. After the test the entity has become a new id.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…