Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

FBNS: More about locking and adding record

 
Klaas van Gelder
Ranch Hand
Posts: 111
Java Linux PHP
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi guys,
Phil (or others), if you read this, I hope you can find some time to react on my previous discussion... Your point regarding calling nothiyAll in lock was very interesting, and I wrote down my own opinion after reconsidering the locking implemetation...

Some more points:
The reason of locking a record during modifying is clear to me (preventing other users of modifying the same record).
But what about adding and deleting records ?
In the case of adding, there is no particular record to be locked. In the case of deleting, maybe the record CAN be locked for preventing another user attempting to modify this record before deletion is complete !??

And what can be the purpose of locking the whole DB by passing -1, as is stated in the method comment for the lock method (Phil already asked me this question) ??

Any suggestions.... ?

Greetz and TIA, Klaas

(You see, I am a pretty newbie on this locking items... ;-)
[ July 10, 2004: Message edited by: Klaas van Gelder ]
 
Satish Avadhanam
Ranch Hand
Posts: 697
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Klaas van Gelder:
Hi guys,
In the case of adding, there is no particular record to be locked.

Yes. But consider this.
Total records are say 30.
1. Client A adds a record and assigns record number say, x.
2. Client B adds a different record and assigns a record numberd say, y.
If above two events occur simultaneously, then you might want to think of maybe synchronizing something in your code which exactly assigns this record number. This is my opinion...only.

In the case of deleting, maybe the record CAN be locked for preventing another user attempting to modify this record before deletion is complete !??

I think record MUST be locked while deleting also.

And what can be the purpose of locking the whole DB by passing -1, as is stated in the method comment for the lock method (Phil already asked me this question) ??

[ July 10, 2004: Message edited by: Klaas van Gelder ]

If server crashes, the least we can do is to make sure data is not corrupted in database. Maybe, if you lock database completely, it might help.


Good Luck, Satish.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic