diff --git a/src/alice/exe.cpp b/src/alice/exe.cpp index bd56dc06e62..5eccff963b2 100644 --- a/src/alice/exe.cpp +++ b/src/alice/exe.cpp @@ -71,9 +71,9 @@ static const TEXT val_errors[] = int EXE_action(const TEXT* database, const SINT64 switches) { bool error = false; - Firebird::AutoMemoryPool newPool(MemoryPool::createPool()); + AliceGlobals* tdgbl = AliceGlobals::getSpecific(); { - AliceGlobals* tdgbl = AliceGlobals::getSpecific(); + Firebird::AutoMemoryPool newPool(MemoryPool::createPool()); AliceContextPoolHolder context(tdgbl, newPool); for (USHORT i = 0; i < MAX_VAL_ERRORS; i++) @@ -130,6 +130,8 @@ int EXE_action(const TEXT* database, const SINT64 switches) } } + tdgbl->uSvc->started(); + return error ? FINI_ERROR : FINI_OK; } @@ -141,9 +143,9 @@ int EXE_action(const TEXT* database, const SINT64 switches) int EXE_two_phase(const TEXT* database, const SINT64 switches) { bool error = false; - Firebird::AutoMemoryPool newPool(MemoryPool::createPool()); + AliceGlobals* tdgbl = AliceGlobals::getSpecific(); { - AliceGlobals* tdgbl = AliceGlobals::getSpecific(); + Firebird::AutoMemoryPool newPool(MemoryPool::createPool()); AliceContextPoolHolder context(tdgbl, newPool); for (USHORT i = 0; i < MAX_VAL_ERRORS; i++) @@ -160,8 +162,6 @@ int EXE_two_phase(const TEXT* database, const SINT64 switches) isc_attach_database(tdgbl->status, 0, database, &handle, dpb.getBufferLength(), reinterpret_cast(dpb.getBuffer())); - tdgbl->uSvc->started(); - if (tdgbl->status[1]) { error = true; @@ -186,6 +186,8 @@ int EXE_two_phase(const TEXT* database, const SINT64 switches) } } + tdgbl->uSvc->started(); + return (error ? FINI_ERROR : FINI_OK); }