I'm using ESE (JetBlue) in an app, when JetAttachDatabase is called it returns JET_errDatabaseDirtyShutdown. What am I supposed to do in my app? my desire is for any uncommeted transactions to be deleted
How to do a Extensible Storage Engine (JetBlue) repair in code?
836 views Asked by stuck At
2
There are 2 answers
0
On
You can configure your application to automatically attempt to clear the "dirty shutdown" by adding the following after JetCreateInstance() and before JetInit(). Yes the order of these things is important:
Api.JetSetSystemParameter(instance, JET_SESID.Nil, Server2003Param.AlternateDatabaseRecoveryPath, 0, Path.GetDirectoryName(databasePath));
(above sample is in C#, but you get the point...)
The last parameter is the location where you'd like the repaired database to appear, so most likely that'd be the same directory as the dirty database file.
Log recovery will be done automatically by the call to JetInit, which will automatically rollback uncomitted transactions. In order for JetInit to work it has to find the logfiles so in this case you have probably either: