Subject | Re: [firebird-support] Question about transactions |
---|---|
Author | Dmitry Kuzmenko |
Post date | 2013-01-06T23:02:35Z |
Hello, W!
Monday, January 7, 2013, 2:33:30 AM, you wrote:
WO> Hello everybody, I have a question:
WO> - Transaction 510 inserts a row
WO> - Transaction 510 commit
ok, data committed.
WO> - Transaction 526 start
WO> - Transaction 526 updates the row inserted by transaction 510
well, row "locked" by update made by transaction 526.
WO> - Transaction 535 start
WO> - Transaction 535 updates the row inserted by transaction 510
no, transaction 535 will get error "deadlock", because
version created by transaction 526 is not committed or rolled back
yet.
WO> - Transaction 542 start
WO> - Transaction 542 updates the row inserted by transaction 510
NO. Same reason that I noted before.
WO> 1. Should be the order for the following commits: 526, 535, 542?
NO.
WO> 2. Or in some cases it could be 542, 535, 526?
NO.
WO> If the answer is 1. it means that if transaction 526 hangs up will avoid
WO> transactions 535 and 542 to finish. Am I right?
No transaction can overwrite version, created by any transaction that
modified some record and has not committed or rolled back changes.
--
Dmitry Kuzmenko, www.ib-aid.com
Monday, January 7, 2013, 2:33:30 AM, you wrote:
WO> Hello everybody, I have a question:
WO> - Transaction 510 inserts a row
WO> - Transaction 510 commit
ok, data committed.
WO> - Transaction 526 start
WO> - Transaction 526 updates the row inserted by transaction 510
well, row "locked" by update made by transaction 526.
WO> - Transaction 535 start
WO> - Transaction 535 updates the row inserted by transaction 510
no, transaction 535 will get error "deadlock", because
version created by transaction 526 is not committed or rolled back
yet.
WO> - Transaction 542 start
WO> - Transaction 542 updates the row inserted by transaction 510
NO. Same reason that I noted before.
WO> 1. Should be the order for the following commits: 526, 535, 542?
NO.
WO> 2. Or in some cases it could be 542, 535, 526?
NO.
WO> If the answer is 1. it means that if transaction 526 hangs up will avoid
WO> transactions 535 and 542 to finish. Am I right?
No transaction can overwrite version, created by any transaction that
modified some record and has not committed or rolled back changes.
--
Dmitry Kuzmenko, www.ib-aid.com