Subject | Re: [ib-support] Deadlock and wait |
---|---|
Author | Marcos Vinicius Dufloth |
Post date | 2001-07-26T16:57:25Z |
Woody:
...
So, I assume that the biggest problem that I face is when user A reads a
record and user B reads the same record. Then, user A changes the record and
commits and user B changes the record and commits, right? In this case, user
B gets a dealock error and rolls back their changes.
...
Why user B don't wait, for predefined time (would be DEADLOCK_TIMEOUT), until user A commit/rollback and then change the record? In some circustances I need that one user wait by a record to change-it. Updating a inventory quantity for a product, for example, is one. The first guy locks the record, the second waits until de first free-it. What the problem with this? Of course if I'm setting a value like "update table set field = value where..." could be a problem, but if I make "udpate table set field = field + value...", where's trouble?
Other: I need read commited to update records in sequence, where one update needs the result of previous update, like "update table set field = field + value...". So, what is the other option, unlike read only changes commited/rollbacked?
Regards from Brazil,
Dufloth.
[Non-text portions of this message have been removed]
...
So, I assume that the biggest problem that I face is when user A reads a
record and user B reads the same record. Then, user A changes the record and
commits and user B changes the record and commits, right? In this case, user
B gets a dealock error and rolls back their changes.
...
Why user B don't wait, for predefined time (would be DEADLOCK_TIMEOUT), until user A commit/rollback and then change the record? In some circustances I need that one user wait by a record to change-it. Updating a inventory quantity for a product, for example, is one. The first guy locks the record, the second waits until de first free-it. What the problem with this? Of course if I'm setting a value like "update table set field = value where..." could be a problem, but if I make "udpate table set field = field + value...", where's trouble?
Other: I need read commited to update records in sequence, where one update needs the result of previous update, like "update table set field = field + value...". So, what is the other option, unlike read only changes commited/rollbacked?
Regards from Brazil,
Dufloth.
[Non-text portions of this message have been removed]