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

Method init

src/jrd/vio.cpp:267–313  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

265 }
266
267 bool init(thread_db* tdbb)
268 {
269 FbStatusVector* status = tdbb->tdbb_status_vector;
270
271 Attachment* att = NULL;
272
273 if (m_ownAttach && !m_attStable.hasData())
274 m_attStable = WorkerAttachment::getAttachment(status, getSweepTask()->m_dbb);
275
276 if (m_attStable)
277 att = m_attStable->getHandle();
278
279 if (!att)
280 {
281 Arg::Gds(isc_bad_db_handle).copyTo(status);
282 return false;
283 }
284
285 tdbb->setDatabase(att->att_database);
286 tdbb->setAttachment(att);
287
288 if (m_ownAttach && !m_tra)
289 {
290 const UCHAR sweep_tpb[] =
291 {
292 isc_tpb_version1, isc_tpb_read,
293 isc_tpb_read_committed, isc_tpb_rec_version
294 };
295
296 try
297 {
298 WorkerContextHolder holder(tdbb, FB_FUNCTION);
299 m_tra = TRA_start(tdbb, sizeof(sweep_tpb), sweep_tpb);
300 DPM_scan_pages(tdbb);
301 }
302 catch(const Exception& ex)
303 {
304 ex.stuffException(tdbb->tdbb_status_vector);
305 return false;
306 }
307 }
308
309 tdbb->setTransaction(m_tra);
310 tdbb->tdbb_flags |= TDBB_sweeper;
311
312 return true;
313 }
314
315 bool m_inuse;
316 bool m_ownAttach;

Callers 3

getResultMethod · 0.45
handlerMethod · 0.45
VIO_sweepFunction · 0.45

Calls 9

GdsClass · 0.85
TRA_startFunction · 0.85
setDatabaseMethod · 0.80
hasDataMethod · 0.45
getHandleMethod · 0.45
copyToMethod · 0.45
setAttachmentMethod · 0.45
stuffExceptionMethod · 0.45
setTransactionMethod · 0.45

Tested by

no test coverage detected