Hi,

I hope you can help me answer a Tapestry5/Hibernate question.
In an onSuccessFromForm Method I want to update a database entity only if a
specific value of that entity is null.

This is how I do it:
Step 1: I read the entity with something like: myObject =
(Object)criteria.list().get(0);
Step 2: I check if myObject.specificValue == null ;
Step 3: If it is null I update the object and do
_session.persist(myUpdatedObject)
Step 4: I commit by :session.getTransaction().commit();

I inject the session with Tapestry annotation and think I am save, but still
not sure about:
Is this the correct implementation or is it possible that User2 updates the
entity after User1 has read the entity and before User1 has persisted the
entity? 

Thanks for your help and all best,
Tom

--
View this message in context: 
http://tapestry.1045711.n5.nabble.com/Tapestry5-Hibernate-Persistence-tp4600362p4600362.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

Reply via email to