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

Method prepareCommit

src/yvalve/DistributedTransaction.cpp:136–162  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

134}
135
136bool DTransaction::prepareCommit(CheckStatusWrapper* status, TdrBuffer& tdr)
137{
138 TEXT host[64];
139 ISC_get_host(host, sizeof(host));
140 const UCHAR hostlen = static_cast<UCHAR>(strlen(host));
141
142 // Build a transaction description record containing the host site and database/transaction
143 // information for the target databases.
144 tdr.clear();
145 tdr.add(TDR_VERSION);
146 tdr.add(TDR_HOST_SITE);
147 tdr.add(hostlen);
148 tdr.add(reinterpret_cast<UCHAR*>(host), hostlen);
149
150 // Get database and transaction stuff for each sub-transaction.
151
152 for (unsigned i = 0; i < sub.getCount(); ++i)
153 {
154 if (sub[i])
155 {
156 if (! buildPrepareInfo(status, tdr, sub[i]))
157 return false;
158 }
159 }
160
161 return true;
162}
163
164void DTransaction::getInfo(CheckStatusWrapper* status,
165 unsigned int itemsLength, const unsigned char* items,

Callers

nothing calls this directly

Calls 4

ISC_get_hostFunction · 0.85
clearMethod · 0.45
addMethod · 0.45
getCountMethod · 0.45

Tested by

no test coverage detected