-
1. Re: Update Hibernate Objects
idyoshin Mar 31, 2010 1:00 PM (in response to ohughes)add @Version private Long version; to your Entities. and rely on optimistick locking. If 2 users start editing the same object - the first who changed to the database would automatically update the version of the object - this would lead for other user (who was a bit slower) - to receive exception with optimistick locking, and require to reload the entity object from the database (latest version) for continue.
regards,
Ilya Dyoshin
-
2. Re: Update Hibernate Objects
gaborj Apr 1, 2010 3:59 PM (in response to ohughes)Use the optimistick locking strategy as Ilya mentioned above, additionally take care to update all caches (session cache and also second level cache if you use it) plus you can use
<a4j:push reRender="msg" eventProducer="#{messageBean.addListener}" interval="3000"/>
tag on the specific page to do periodical updates for the other users... -
3. Re: Update Hibernate Objects
ohughes Apr 1, 2010 4:04 PM (in response to ohughes)Thanks for your replies, and I do want to end up using the Pesimistic locking mechanism, but haven't found a nice easy example yet :-)
With regards to the updating of all caches, how do I do this from Seam?
And I am using Icefaces, so the push server from them will do the same thing for me (I hope).
Thanks again,
Osh