orientphoebus wrote:
But for transient object, I think it's necessary to select-before-update. This extra query is necessary for data integrity. Especially currently, NHibernate insert the object anyways if I invoke save. That could cause trouble.
Can you give an example ?
When you say "select-before-update", do you mean that NHibernate should select the ID of the transient object to make sure it is not in the database ? In this case, there are two possibilities :
1- The ID is
assigned by the App/NHibernate; this means that it is their responsability to validate the uniquiness of this ID
2- The ID is
native, so the database will give a valid ID.