To do: check the maximum allowed dbs in a two phase commit. Q: what is the maximum?
| 425 | // To do: check the maximum allowed dbs in a two phase commit. |
| 426 | // Q: what is the maximum? |
| 427 | DTransaction* DTransaction::join(CheckStatusWrapper* status, ITransaction* transaction) |
| 428 | { |
| 429 | try |
| 430 | { |
| 431 | status->init(); |
| 432 | |
| 433 | WriteLockGuard guard(rwLock, FB_FUNCTION); |
| 434 | |
| 435 | // reserve array element to make sure we have a place for copy of transaction |
| 436 | FB_SIZE_T pos = sub.add(NULL); |
| 437 | |
| 438 | // Nothing throws exceptions after reserving space in sub-array up to the end of block |
| 439 | ITransaction* traCopy = transaction->enterDtc(status); |
| 440 | if (traCopy) |
| 441 | { |
| 442 | sub[pos] = traCopy; |
| 443 | return this; |
| 444 | } |
| 445 | |
| 446 | // enterDtc() failed - remove reserved array element |
| 447 | sub.remove(pos); |
| 448 | } |
| 449 | catch (const Exception& ex) |
| 450 | { |
| 451 | ex.stuffException(status); |
| 452 | } |
| 453 | |
| 454 | return NULL; |
| 455 | } |
| 456 | |
| 457 | ITransaction* DTransaction::validate(CheckStatusWrapper* status, IAttachment* attachment) |
| 458 | { |
no test coverage detected