Hi, I'm not sure if I'm doing my UPDATE's and DELETE's the proper way:
Basically, I want to make sure what I updates, or deletes, in fact exists (ie not deleted by another user) before I actually perform the operation:
Code:
o_session = SetupBISConnection(...)
trx = o_session.BeginTransaction()
Try
'IF the object with specified UIN does not exist (that it's deleted by another user), then NHibernate will throw ObjectNotFoundException.
obj = o_session.Load(GetType(CObj), UIN)
Catch ex As NHibernate.ObjectNotFoundException
'object to be updated does not exist - abort delete
Throw ex
End Try
'Okay, if no exception so far, it means the object is there...
o_session.Delete(plan)
o_session.Flush()
trx.Commit()
Any pointer? Thanks in advance.