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

Method getBoundConnection

src/jrd/extds/ExtDS.cpp:394–434  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

392}
393
394Connection* Provider::getBoundConnection(Jrd::thread_db* tdbb,
395 const Firebird::PathName& dbName, Firebird::ClumpletReader& dpb,
396 TraScope tra_scope, bool isCurrentAtt)
397{
398 Database* dbb = tdbb->getDatabase();
399 Attachment* att = tdbb->getAttachment();
400 CryptHash ch;
401 if (!isCurrentAtt)
402 ch.assign(att->att_crypt_callback);
403
404 MutexLockGuard guard(m_mutex, FB_FUNCTION);
405
406 AttToConnMap::Accessor acc(&m_connections);
407 if (acc.locate(locGreatEqual, AttToConn(att, NULL)))
408 {
409 do
410 {
411 Connection* conn = acc.current().m_conn;
412
413 if (conn->getBoundAtt() != att)
414 break;
415
416 if (conn->isSameDatabase(dbName, dpb, ch) &&
417 conn->isAvailable(tdbb, tra_scope))
418 {
419 fb_assert(conn->getProvider() == this);
420
421#ifdef EDS_DEBUG
422 if (!ConnectionsPool::checkBoundConnection(tdbb, conn))
423 continue;
424#endif
425
426 if (!isCurrentAtt)
427 conn->resetRedirect(att->att_crypt_callback);
428 return conn;
429 }
430 } while (acc.getNext());
431 }
432
433 return NULL;
434}
435
436void Provider::jrdAttachmentEnd(thread_db* tdbb, Jrd::Attachment* att, bool forced)
437{

Callers 1

getConnectionMethod · 0.80

Calls 12

AttToConnClass · 0.85
getDatabaseMethod · 0.80
getBoundAttMethod · 0.80
getAttachmentMethod · 0.45
assignMethod · 0.45
locateMethod · 0.45
currentMethod · 0.45
isSameDatabaseMethod · 0.45
isAvailableMethod · 0.45
getProviderMethod · 0.45
resetRedirectMethod · 0.45
getNextMethod · 0.45

Tested by

no test coverage detected