Login ProductsSalesSupportDownloadsAbout |
Home » Technical Support » ElevateDB Technical Support » Support Forums » ElevateDB General » View Thread |
Messages 1 to 8 of 8 total |
RESTORE fails due to LOck. |
Fri, Jul 20 2018 3:02 AM | Permanent Link |
Ian Branch | Hi Team,
Working with Backup & RESTORE. BACKUP seems to work fine the Data is in the Store. When I go to RESTORE per the following: {sql} procedure TForm3.btnRestoreClick(Sender: TObject); begin // Screen.Cursor := crHourglass; // DBC1.Connected := False; // DBS1.Execute('RESTORE DATABASE "DBiWorkflow" FROM "DBiWorkflow-Backup-' + Engine.DateToSQLStr(Date) + '" IN STORE "Backups" INCLUDE CATALOG'); // MessageBeep(MB_ICONINFORMATION); // tqBackup.Open; // Screen.Cursor := crDefault; // MessageDlg('DBiWorkflow database restore completed.', mtInformation, [mbOK], 0); // end; {sql} I get an error # 300 - "Cannot lock the Database DBiWorkflow for exclusive access" As at the DBS1.Execute('... only the TEDBEngine & TEDBSession are 'Active'. What else could be locking the database? Regards & TIA, Ian |
Fri, Jul 20 2018 3:22 AM | Permanent Link |
Malcolm Taylor | Hi Ian
I had an issue lke that a long time ago .. and I have a note in my code: // added the next line because some restores fail otherwise.. // .. don't know why DM.EDBEngine1.Close; before running my Session.Execute('RESTORE ..... At a guess there is still something else econnected. Closing the Engine 'makes sure'. Maybe someone can tell me a better 'cludge'. <bg> |
Fri, Jul 20 2018 3:46 AM | Permanent Link |
Roy Lambert NLH Associates Team Elevate | Ian
Is there another user active, do you have the database open in EDBManager? If the above is OK what about setting the engine inactive rather than DBC1.Connected := False; Roy Lambert |
Fri, Jul 20 2018 4:38 AM | Permanent Link |
Ian Branch | Hi Malcolm,
Yep, that did it Tks. The Configuration.Backups table is being displayed in a DBGrid. After the Restore operation I do the following: {code} DBC1.Open; << This should re-open the database. tqBackup.Open; << This should re-open configuration.backups. DBGrid1.Refresh; << Just in case. {code} I don't get any errors, nor do I get the Backups data displayed. Any thoughts? Regards & Tks, Ian |
Fri, Jul 20 2018 4:40 AM | Permanent Link |
Ian Branch | Roy Lambert wrote:
> Is there another user active, do you have the database open in EDBManager? > Nope. Only one table and that is for configuration.engine nd was being closed by DBC1.Close; > If the above is OK what about setting the engine inactive rather than DBC1.Connected := False; Yep. That did it. Regards, Ian |
Fri, Jul 20 2018 5:20 AM | Permanent Link |
Malcolm Taylor | Ian, not quite sure what you are saying, but ..
After the Restore, and having stopped the Engine, you will have to restart things much as you will be doing when launching your program in the first place. Malcolm |
Fri, Jul 20 2018 5:36 AM | Permanent Link |
Ian Branch | Malcolm wrote:
> After the Restore, and having stopped the Engine, you will have to > restart things much as you will be doing when launching your program in > the first place. Yup. This did it. {code} DBS1.Execute('SET BACKUPS STORE TO "Backups"'); tqBackup.Open; DBGrid1.Refresh; {code} Regards & Tks, Ian |
Mon, Jul 23 2018 12:06 PM | Permanent Link |
Tim Young [Elevate Software] Elevate Software, Inc. timyoung@elevatesoft.com | Ian,
<< I get an error # 300 - "Cannot lock the Database DBiWorkflow for exclusive access" As at the DBS1.Execute('... only the TEDBEngine & TEDBSession are 'Active'. What else could be locking the database? >> It could be a temporary database connection: https://www.elevatesoft.com/manual?action=viewmethod&id=edb2&product=rsdelphiwin32&version=10T&comp=TEDBSession&method=DropConnections If you have any tables, queries, or scripts in your session(s) that reference databases by name, but don't reference an *explicit* TEDBDatabase instance, then EDB will create a temporary database for you and will be subject to the behavior described in the above link. Tim Young Elevate Software www.elevatesoft.com |
This web page was last updated on Saturday, April 27, 2024 at 08:52 PM | Privacy PolicySite Map © 2024 Elevate Software, Inc. All Rights Reserved Questions or comments ? E-mail us at info@elevatesoft.com |