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

Method Session

src/plugins/profiler/Profiler.cpp:1381–1409  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1379//--------------------------------------
1380
1381Session::Session(ThrowStatusExceptionWrapper* status, ProfilerPlugin* aPlugin,
1382 const char* aDescription, ISC_TIMESTAMP_TZ aStartTimestamp)
1383 : plugin(aPlugin),
1384 startTimestamp(aStartTimestamp),
1385 description(defaultPool(), aDescription)
1386{
1387 FB_MESSAGE(SequenceMessage, ThrowStatusExceptionWrapper,
1388 (FB_BIGINT, value)
1389 ) sequenceMessage(status, MasterInterfacePtr());
1390 sequenceMessage.clear();
1391
1392 constexpr auto sequenceSql = "select next value for plg$prof_profile_id from rdb$database";
1393
1394 auto transaction = makeNoIncRef(plugin->userAttachment->startTransaction(status, 0, nullptr));
1395
1396 auto resultSet = makeNoIncRef(plugin->userAttachment->openCursor(status, transaction, 0, sequenceSql,
1397 SQL_DIALECT_CURRENT,
1398 nullptr, nullptr, sequenceMessage.getMetadata(), nullptr, 0));
1399
1400 resultSet->fetchNext(status, sequenceMessage.getData());
1401 id = sequenceMessage->value;
1402
1403 transaction->commit(status);
1404 transaction.clear();
1405
1406 plugin->sessions.add(makeRef(this));
1407
1408 addRef();
1409}
1410
1411void Session::cancel(ThrowStatusExceptionWrapper* status)
1412{

Callers

nothing calls this directly

Calls 11

MasterInterfacePtrClass · 0.85
makeNoIncRefFunction · 0.85
makeRefFunction · 0.85
clearMethod · 0.45
startTransactionMethod · 0.45
openCursorMethod · 0.45
getMetadataMethod · 0.45
fetchNextMethod · 0.45
getDataMethod · 0.45
commitMethod · 0.45
addMethod · 0.45

Tested by

no test coverage detected