Thank you david but i´m a newbie user and need some explanation about how Hibernate assigns an Id, how it works.
I did not find anything about my question.
Suppose i have two users doing an insert operation in different web transaction.
operationOne
session.save(objectOne)
1) now Hibernate goes to database select max id, add one and sets it to the object !?
2) or then just when the transaction is committed it´s assigned calling session.flush?
operationTwo
differentSession.save(objectTwo)
3) between that operation another is saving an object and assigns an id, so there is a possibility of two different objects to have the same identifier (selecting does not use lock) ?!
4) Even if hibernates generates it on transacion.commit() ?!
Sorry by english, and thanks again !
|