The following is a working example. It uses hidden version. Try opening in two 
browsers and changing the person in both - you'll get the optimistic lock 
exception. Don't check the versions yourself - leave that to Hibernate.

        
http://jumpstart.doublenegative.com.au/jumpstart/examples/input/totalcontroledit1/1

BTW, I think your update should be in onValidateFromYourForm(). Probably 
@CommitAfter should be on onValidateFromYourForm() too - but I don't use 
tapestry-hibernate so I don't know if that is legal. 

Nonetheless, think in these terms: you don't really know whether you have a 
success of failure until the transaction has been committed (or rolled back), 
so the transaction should be before you get to onSuccess() or onFailure().

Cheers,

Geoff

On 01/12/2012, at 3:01 AM, nquirynen wrote:

> Thanks for the ideas, I will look into this :)
> 
> 
> 
> --
> View this message in context: 
> http://tapestry.1045711.n5.nabble.com/Tapestry-Hibernate-optimistic-locking-tp5718413p5718431.html
> Sent from the Tapestry - User mailing list archive at Nabble.com.
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org

Reply via email to