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

Method start_transaction

src/remote/server/server.cpp:6819–6876  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

6817
6818
6819ISC_STATUS rem_port::start_transaction(P_OP operation, P_STTR * stuff, PACKET* sendL)
6820{
6821/**************************************
6822 *
6823 * s t a r t _ t r a n s a c t i o n
6824 *
6825 **************************************
6826 *
6827 * Functional description
6828 * Start a transaction.
6829 *
6830 **************************************/
6831 LocalStatus ls;
6832 CheckStatusWrapper status_vector(&ls);
6833
6834 Rdb* rdb = this->port_context;
6835 if (bad_db(&status_vector, rdb))
6836 return this->send_response(sendL, 0, 0, &status_vector, false);
6837
6838 ServTransaction iface(operation == op_reconnect ?
6839 rdb->rdb_iface->reconnectTransaction(&status_vector,
6840 stuff->p_sttr_tpb.cstr_length, stuff->p_sttr_tpb.cstr_address) :
6841 rdb->rdb_iface->startTransaction(&status_vector,
6842 stuff->p_sttr_tpb.cstr_length, stuff->p_sttr_tpb.cstr_address));
6843
6844 OBJCT object = 0;
6845 if (!(status_vector.getState() & IStatus::STATE_ERRORS))
6846 {
6847 Rtr* transaction = make_transaction(rdb, iface);
6848 if (transaction)
6849 {
6850 object = transaction->rtr_id;
6851 if (operation == op_reconnect)
6852 transaction->rtr_limbo = true;
6853#ifdef DEBUG_REMOTE_MEMORY
6854 printf("start_transaction(server) allocate trans %x\n", transaction);
6855#endif
6856 }
6857 else
6858 {
6859 if (operation != op_reconnect)
6860 {
6861 iface->rollback(&status_vector);
6862 }
6863 else
6864 {
6865 // Note that there is an underlying transaction pool
6866 // that won't be released until this connection is
6867 // detached. At least release the y-valve iface.
6868 iface->disconnect(&status_vector);
6869 }
6870
6871 (Arg::Gds(isc_too_many_handles)).copyTo(&status_vector);
6872 }
6873 }
6874
6875 return this->send_response(sendL, object, 0, &status_vector, false);
6876}

Callers 1

process_packetFunction · 0.80

Calls 10

send_responseMethod · 0.95
bad_dbFunction · 0.85
GdsClass · 0.85
make_transactionFunction · 0.70
reconnectTransactionMethod · 0.45
startTransactionMethod · 0.45
getStateMethod · 0.45
rollbackMethod · 0.45
disconnectMethod · 0.45
copyToMethod · 0.45

Tested by

no test coverage detected