Hi, this sounds like a common database problem. You might want to consider some kind of pessimistic locking. Basically you lock the object when you start editing and prevent all access to it for the duration of the lock. You could also do an optimistic lock which means that when you change an object it will only be committed if the object hasn't changed between the time you got your lock and the time you want to commit it. This doens't prevent you from having done unnecessary work however. Most db's support optimistic locking, but not pessimistic locking.
If you want to use this at the application level you will have to do it yourself. You could put a variable somewhere to track wether an object is being edited and base access restrictions off of that. However you have to be very carefull about making sure you don't get any deadlock or race conditions. I suggest you delve into database world and read about how other people have solved this problem. mvg, Jasper On 5/30/06, Julian Tillmann <[EMAIL PROTECTED]> wrote:
Hello everyone, Within our struts web application in which we have edit-actions within a user can be busy editing data in the form for several minutes. The problem is, if another user is also editing the data at the same time, one of the is eventually going to overwrite the changes of the other and the other will have worked completely in vain. So my question would be whether there's some way to prevent this from happening, some kind of "lock down" method for edit-actions? I think this problem is not uncommon, can someone give me a tip? thanks in advance Julian -- Bis zu 70% Ihrer Onlinekosten sparen: GMX SmartSurfer! Kostenlos downloaden: http://www.gmx.net/de/go/smartsurfer --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]