|
>
> I've got a problem. If an nhibernate-error occurs, I perform a rollback.
> But after this it's not possible to use the current session but I also don't
> want to restart the program.
You have to Close session after Rollback. Even more - you have to close session after hibernate exceptions. Closing supposed to cleanup all the mess that caused exception and it will make all your objects Detached. To reattach these objects to newly opened session you can:
- call Session.update(detached_object) if your detached object is modified
- or call Session.lock if your detached object is not modified.
> How can I create a new session?
Well, do it the same way as you opened first session:)
|