[hibernate-users] Extended sessions and (lack of) recovery from Hibernate exceptions (ie: validation)

Vallon, Justin jvallon at bear.com
Mon Mar 10 10:39:43 EDT 2008


Suppose a field has a validator, and the field is made invalid (age <
0).  When flushing, the validator runs, and throws an exception.  The
exception handling section
(http://www.hibernate.org/hib_docs/v3/reference/en/html_single/#transact
ions-demarcation-exceptions) states that if any method throws an
exception, the session must be closed.

 

So, what to do if session-per-conversation is used?  If hibernate
validation is used, then flush of invalid data corrupts the session -
the application then needs to ask the user to start over, or else build
complex recovery logic (new session, copy data to new session).

 

How does hibernate validation interact with extended sessions?

 

-Justin

office 8-383-6725, 212-272-6725; cell 917-861-6042

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/hibernate-users/attachments/20080310/659ec421/attachment.html 
-------------- next part --------------


***********************************************************************
Bear Stearns is not responsible for any recommendation, solicitation, 
offer or agreement or any information about any transaction, customer 
account or account activity contained in this communication.
***********************************************************************



More information about the hibernate-users mailing list