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

Method start

src/yvalve/DistributedTransaction.cpp:553–593  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

551}
552
553YTransaction* DtcStart::start(CheckStatusWrapper* status)
554{
555 try
556 {
557 status->init();
558
559 RefPtr<DTransaction> dtransaction(FB_NEW DTransaction);
560
561 unsigned cnt = components.getCount();
562 if (status->getState() & IStatus::STATE_ERRORS)
563 status_exception::raise(status);
564 if (cnt == 0)
565 (Arg::Gds(isc_random) << "No attachments to start distributed transaction provided").raise();
566
567 for (unsigned i = 0; i < cnt; ++i)
568 {
569 ITransaction* started = components[i].att->startTransaction(status, components[i].tpbLen, components[i].tpb);
570 if (status->getState() & IStatus::STATE_ERRORS)
571 status_exception::raise(status);
572
573 dtransaction->join(status, started);
574 if (status->getState() & IStatus::STATE_ERRORS)
575 {
576 started->release();
577 status_exception::raise(status);
578 }
579 }
580
581 YTransaction* rc = FB_NEW YTransaction(NULL, dtransaction);
582 rc->addRef();
583 dtransaction->addRef();
584 this->dispose();
585 return rc;
586 }
587 catch (const Exception& ex)
588 {
589 ex.stuffException(status);
590 }
591
592 return NULL;
593}
594
595YTransaction* Dtc::join(CheckStatusWrapper* status, ITransaction* one, ITransaction* two)
596{

Callers

nothing calls this directly

Calls 13

disposeMethod · 0.95
raiseFunction · 0.85
GdsClass · 0.85
YTransactionClass · 0.70
initMethod · 0.45
getCountMethod · 0.45
getStateMethod · 0.45
raiseMethod · 0.45
startTransactionMethod · 0.45
joinMethod · 0.45
releaseMethod · 0.45
addRefMethod · 0.45

Tested by

no test coverage detected