Anton Kuzmin wrote:Is it allowed?
Anton Kuzmin wrote:I want to keep necessary data separate because it's not allowed to change structure of original db file in my project.
Anton Kuzmin wrote:I could use "owner" column for optimistic locking at room booking but it won't help in situations when two different people update the record.
Regards,
Anayonkar Shivalkar (SCJP, SCWCD, OCMJD, OCEEJBD)
Anayonkar Shivalkar wrote:
Anton Kuzmin wrote:I could use "owner" column for optimistic locking at room booking but it won't help in situations when two different people update the record.
I don't get what do you mean by this. Only one thread will get a lock on a record at a time, and if the room is booked by one thread, all other threads will get error (i.e. exception at code level) that room is already booked etc. It's as simple as that.
Anayonkar Shivalkar wrote:
Anton Kuzmin wrote:I want to keep necessary data separate because it's not allowed to change structure of original db file in my project.
I am curious about this. What is this necessary data? And why will it alter the structure of original db file?
Anton Kuzmin wrote:But in my program, people will also be able to update data like price. In this case "owner" column is not enough.
Regards,
Anayonkar Shivalkar (SCJP, SCWCD, OCMJD, OCEEJBD)
Anton Kuzmin wrote:public void updateRecord(long recNo, String[] data, long lockCookie)
Regards,
Anayonkar Shivalkar (SCJP, SCWCD, OCMJD, OCEEJBD)
Anton Kuzmin wrote:Result: Record has old price.
Anton Kuzmin wrote:With optimistic locking enabled along side with current locking rules, second guy will get nice message that data has been changed while he was thinking and he needs to reload it.
Anton Kuzmin wrote:I do not do logical locking at record opened for edit because it creates even more problems like whether to use lock timeout, waiting for lock for very long time.
Regards,
Anayonkar Shivalkar (SCJP, SCWCD, OCMJD, OCEEJBD)
What are you doing? You are supposed to be reading this tiny ad!
Smokeless wood heat with a rocket mass heater
https://woodheat.net
|