Results 1 to 1 of 1
Thread: locking strategies
- 09-04-2009, 12:36 AM #1Member
- Join Date
- Aug 2009
- Costa Brava
- Rep Power
Probably this is an stupid question, but I don't find any solution by myself, so here I am.
I'm working with MySQL 5.1
I've to do several table maintenance GUI, it's and ease job, no complex rules at all, just code and several fields most of them just text.
I want a pessimistic locking, I'm not agree with does applications that when you has filled all the record and press "Save", the application responds "you have lost your work due another person has modified this record before you".
what I do to avoid this, is open a transaction, do a select for update, and keep the transaction opened until the user press the save/cancel button.
This behaviour is OK for the basic one's. My problem raises when a form opens another form (ex:families opens sub-families). In that case, I have the transaction already opened, in one way is ok, since no one is going to delete the family that I'm working on sub-families, but in the other hand, when I commit the second form, it really commit a subtransaction so if the root form doesn't commit I lose all the changes made in sub-family form. Since maybe there is no changes on families form ( I just cross to reach sub-families form) even the save button is disabled.
which approach you use to do ?
- By mwildam in forum New To JavaReplies: 1Last Post: 09-16-2008, 05:11 PM
- By jithan in forum New To JavaReplies: 0Last Post: 09-02-2008, 08:09 AM
- By jithan in forum New To JavaReplies: 1Last Post: 08-28-2008, 07:42 PM
- By coco in forum AWT / SwingReplies: 1Last Post: 07-31-2007, 08:21 AM