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

Function create_attachment

src/jrd/jrd.cpp:7537–7604  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

7535
7536
7537static JAttachment* create_attachment(const PathName& alias_name,
7538 Database* dbb,
7539 JProvider* provider,
7540 const DatabaseOptions& options,
7541 bool newDb)
7542{
7543/**************************************
7544 *
7545 * c r e a t e _ a t t a c h m e n t
7546 *
7547 **************************************
7548 *
7549 * Functional description
7550 * Create attachment and link it to dbb
7551 *
7552 **************************************/
7553 fb_assert(dbb->locked());
7554
7555 Attachment* attachment = NULL;
7556 { // scope
7557 MutexLockGuard guard(newAttachmentMutex, FB_FUNCTION);
7558 if (engineShutdown)
7559 {
7560 status_exception::raise(Arg::Gds(isc_att_shutdown));
7561 }
7562
7563 attachment = Attachment::create(dbb, provider);
7564 attachment->att_next = dbb->dbb_attachments;
7565 dbb->dbb_attachments = attachment;
7566 }
7567
7568 attachment->att_filename = alias_name;
7569 attachment->att_network_protocol = options.dpb_network_protocol;
7570 attachment->att_remote_crypt = options.dpb_remote_crypt;
7571 attachment->att_remote_address = options.dpb_remote_address;
7572 attachment->att_remote_pid = options.dpb_remote_pid;
7573 attachment->att_remote_flags = options.dpb_remote_flags;
7574 attachment->att_remote_process = options.dpb_remote_process;
7575 attachment->att_remote_host = options.dpb_remote_host;
7576 attachment->att_remote_os_user = options.dpb_remote_os_user;
7577 attachment->att_client_version = options.dpb_client_version;
7578 attachment->att_remote_protocol = options.dpb_remote_protocol;
7579 attachment->att_ext_call_depth = options.dpb_ext_call_depth;
7580
7581 StableAttachmentPart* sAtt = FB_NEW StableAttachmentPart(attachment);
7582 attachment->setStable(sAtt);
7583 sAtt->addRef();
7584
7585 JAttachment* jAtt = NULL;
7586 try
7587 {
7588 sAtt->manualLock(attachment->att_flags);
7589 jAtt = FB_NEW JAttachment(sAtt);
7590 }
7591 catch (const Exception&)
7592 {
7593 sAtt->release();
7594 throw;

Callers 1

initAttachmentFunction · 0.85

Calls 11

raiseFunction · 0.85
GdsClass · 0.85
createFunction · 0.85
JAttachmentClass · 0.85
setStableMethod · 0.80
manualLockMethod · 0.80
lockedMethod · 0.45
addRefMethod · 0.45
releaseMethod · 0.45
setInterfaceMethod · 0.45

Tested by

no test coverage detected