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

Method doDetach

src/jrd/extds/InternalDS.cpp:175–213  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

173}
174
175void InternalConnection::doDetach(thread_db* tdbb)
176{
177 fb_assert(m_attachment);
178 if (!m_attachment->getHandle())
179 return;
180
181 if (isCurrent())
182 {
183 m_attachment = NULL;
184 }
185 else
186 {
187 FbLocalStatus status;
188
189 RefPtr<JAttachment> att = m_attachment;
190 m_attachment = NULL; // release and nullify
191
192 { // scope
193 EngineCallbackGuard guard(tdbb, *this, FB_FUNCTION);
194 att->detach(&status);
195 }
196
197 if (!(status->getState() & IStatus::STATE_ERRORS))
198 att.clear();
199
200 if (status->getErrors()[1] == isc_att_shutdown || status->getErrors()[1] == isc_shutdown)
201 {
202 status->init();
203 }
204
205 if (status->getState() & IStatus::STATE_ERRORS)
206 {
207 m_attachment = att;
208 raise(&status, tdbb, "JAttachment::detach");
209 }
210 }
211
212 fb_assert(!m_attachment);
213}
214
215bool InternalConnection::cancelExecution(bool /*forced*/)
216{

Callers

nothing calls this directly

Calls 7

raiseFunction · 0.85
getHandleMethod · 0.45
detachMethod · 0.45
getStateMethod · 0.45
clearMethod · 0.45
getErrorsMethod · 0.45
initMethod · 0.45

Tested by

no test coverage detected