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

Method init

src/jrd/extds/ExtDS.cpp:2590–2624  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2588// EngineCallbackGuard
2589
2590void EngineCallbackGuard::init(thread_db* tdbb, Connection& conn, const char* from)
2591{
2592 m_tdbb = tdbb;
2593 m_mutex = &conn.m_mutex;
2594 m_saveConnection = NULL;
2595
2596 if (m_tdbb && m_tdbb->getDatabase())
2597 {
2598 jrd_tra* transaction = m_tdbb->getTransaction();
2599 if (transaction)
2600 {
2601 if (transaction->tra_callback_count >= MAX_CALLBACKS)
2602 ERR_post(Arg::Gds(isc_exec_sql_max_call_exceeded));
2603
2604 transaction->tra_callback_count++;
2605 }
2606
2607 Jrd::Attachment* attachment = m_tdbb->getAttachment();
2608 if (attachment)
2609 {
2610 m_saveConnection = attachment->att_ext_connection;
2611 m_stable = attachment->getStable();
2612 m_stable->getSync()->leave();
2613
2614 Jrd::AttSyncLockGuard guardAsync(*m_stable->getSync(true, true), FB_FUNCTION);
2615 Jrd::AttSyncLockGuard guardMain(*m_stable->getSync(), FB_FUNCTION);
2616 if (m_stable->getHandle() == attachment)
2617 attachment->att_ext_connection = &conn;
2618 }
2619 }
2620
2621 if (m_mutex) {
2622 m_mutex->enter(from);
2623 }
2624}
2625
2626EngineCallbackGuard::~EngineCallbackGuard()
2627{

Callers 5

cancelExecutionMethod · 0.45
doRollbackMethod · 0.45
doDetachMethod · 0.45
doRollbackMethod · 0.45
raiseMethod · 0.45

Calls 10

GdsClass · 0.85
getDatabaseMethod · 0.80
ERR_postFunction · 0.50
getTransactionMethod · 0.45
getAttachmentMethod · 0.45
getStableMethod · 0.45
leaveMethod · 0.45
getSyncMethod · 0.45
getHandleMethod · 0.45
enterMethod · 0.45

Tested by

no test coverage detected