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

Method startTransaction

src/remote/client/interface.cpp:7431–7479  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

7429
7430
7431ITransaction* Attachment::startTransaction(CheckStatusWrapper* status, unsigned int tpbLength,
7432 const unsigned char* tpb)
7433{
7434/**************************************
7435 *
7436 * g d s _ t r a n s a c t i o n
7437 *
7438 **************************************
7439 *
7440 * Functional description
7441 * Start a transaction.
7442 *
7443 **************************************/
7444 try
7445 {
7446 reset(status);
7447
7448 CHECK_HANDLE(rdb, isc_bad_db_handle);
7449 rem_port* port = rdb->rdb_port;
7450 RefMutexGuard portGuard(*port->port_sync, FB_FUNCTION);
7451
7452 if (/***tpbLength < 0 ||***/ (tpbLength > 0 && !tpb))
7453 {
7454 status_exception::raise(Arg::Gds(isc_bad_tpb_form));
7455 }
7456
7457 // Validate data length
7458
7459 CHECK_LENGTH(port, tpbLength);
7460
7461 PACKET* packet = &rdb->rdb_packet;
7462 packet->p_operation = op_transaction;
7463 P_STTR* trans = &packet->p_sttr;
7464 trans->p_sttr_database = rdb->rdb_id;
7465 trans->p_sttr_tpb.cstr_length = tpbLength;
7466 trans->p_sttr_tpb.cstr_address = tpb;
7467
7468 send_and_receive(status, rdb, packet);
7469
7470 ITransaction* t = FB_NEW Transaction(make_transaction(rdb, packet->p_resp.p_resp_object), this);
7471 t->addRef();
7472 return t;
7473 }
7474 catch (const Exception& ex)
7475 {
7476 ex.stuffException(status);
7477 }
7478 return NULL;
7479}
7480
7481
7482void Attachment::transactRequest(CheckStatusWrapper* status, ITransaction* apiTra,

Callers 2

start_transactionMethod · 0.45
initReplicaMethod · 0.45

Calls 10

CHECK_HANDLEFunction · 0.85
raiseFunction · 0.85
GdsClass · 0.85
CHECK_LENGTHFunction · 0.85
send_and_receiveFunction · 0.85
resetFunction · 0.70
TransactionClass · 0.70
make_transactionFunction · 0.70
addRefMethod · 0.45
stuffExceptionMethod · 0.45

Tested by

no test coverage detected