These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]

Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: Transactions, Recoverability and Validation
PostPosted: Tue May 06, 2008 11:04 pm 

Joined: Fri Jul 29, 2005 9:46 am
Posts: 101
One of the problematic (perhaps only for me?) things about validation is that sometimes it is triggered on "entityManager.persist" (like not null) and other times is triggered on "flush" or "at the commit of a transaction".

I think it should be possible to delay all validations until the commit of the transaction (firing validation at different times makes it harder to have it coded at an unified place), therefore I think the use of "not null" at the database level should be discouraged.

Another thing that worries me about is what should be done when transactions fail, in a typical stateless web application, there are no problems (all objects that failed validation are disposed and reloaded in the next request, and all changes in data are applied to them from the html form) but in Swing based (or stateful web applications) one doesn't get rid of modified objects until the end of the use case/conversation... but IMHO the tradition in Hibernate is to treat exceptions as unrecoverable... will that change with the new validation framework? will we be allowed to retry the saving of our objects? (Because the way I see it the validations should automatically be called "on transaction commit" if configured to do so, and the only way to notify the user (at that point) that validations failed is with an exception).

What are your thoughts on this?

 Post subject:
PostPosted: Thu Jun 05, 2008 5:56 pm 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
This is an interesting problem that has more to do with JPA than anything else.
I have not easy idea to solve that, but I noted the point.


Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.