This project has moved and is read-only. For the latest updates, please go here.

JetRestoreInstance issue on WS2003

Apr 2, 2013 at 2:38 PM

I got a problem with JetRestoreInstance. Same code is working flawlessly on Win7/Win8 but it crashes on WS2003 R2 (fully updated) - when I debug the whole application hangs at 52% (restore callback).

Can you advise?

Here is the code that is not working:
May 29, 2013 at 9:22 AM
I finally got a chance to look at this. Thanks a lot for the repro -- it was a huge help!

It is indeed a bug in esent.dll:
struct RSTMAP * 0x034db158
   +0x000 szDatabaseName   : 0x034ddd70  "C:\RavenDB\RavenDB-Build-2330\Server\Database\Databases\DB1\Data"
   +0x004 szNewDatabaseName : 0x034dddd8  "C:\investigate\ayende\esent-ws2003-restore-issue-master\EsentTest\bin\Debug\Restore\DB10Data"
   +0x008 szGenericName    : 0x034d0d60  "Data"
   +0x00c fDestDBReady     : 0n1
   +0x010 fSLVFile         : 0n0
   +0x014 signDatabase     : SIGNATURE
As you can see, the 'szNewDatabaseName' variable is wrong -- it's missing the backslash between 'DB10' and 'Data'.
My experience though was that it didn't hang; but it crashed.

Looking at the code, JetExternalRestore() may work around this bug ( It is implemented on Win2003, despite MSDN saying that it was introduced in Vista. But unfortunately it hasn't been added it to ManagedEsent.