Rather than question the reuse of a corrupted session, I would ask: 1. how do you know the exception is a constraint violation? 2. why you are expecting a constraint violation? 3. why wasn't this accounted for before committing the transaction?
# 3 would solve a majority of your errors? confirm there is not a validation constraint before saving. There is still the possibility that between validating the constraint and committing the transaction the constraint could be broken, but this would truly be an exception in which case you want/need to t abandon the session and try again. This could be done manually by reporting back to the user and allowing them to input new data, or it could be handled automatically by the system. On Aug 5, 5:26 am, YJingLee <[email protected]> wrote: > If I save the object, the database violates the constraint, resulting > in errors, out abnormal, I would like to once again save the > modifications to the object, the Session can not be used, and I do not > want to re-opening Session, the continued use of this Session, there > is no solution? --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "nhusers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/nhusers?hl=en -~----------~----~----~----~------~----~------~--~---
