MCPcopy Create free account
hub / github.com/FirebirdSQL/firebird / join

Method join

src/yvalve/DistributedTransaction.cpp:427–455  ·  view source on GitHub ↗

To do: check the maximum allowed dbs in a two phase commit. Q: what is the maximum?

Source from the content-addressed store, hash-verified

425// To do: check the maximum allowed dbs in a two phase commit.
426// Q: what is the maximum?
427DTransaction* 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
457ITransaction* DTransaction::validate(CheckStatusWrapper* status, IAttachment* attachment)
458{

Callers 1

startMethod · 0.45

Calls 8

YTransactionClass · 0.70
initMethod · 0.45
addMethod · 0.45
enterDtcMethod · 0.45
removeMethod · 0.45
stuffExceptionMethod · 0.45
getStateMethod · 0.45
addRefMethod · 0.45

Tested by

no test coverage detected