This project has moved. For the latest updates, please go here.

KB3199209 cause failures on comaction in Windows 10 machines

Oct 27, 2016 at 12:03 PM
I have the following code that started failing recently.
I believe that it is related to KB3199209 being installed.

The code is basically:
            var dataDir = @"C:\work\test";
            var src = Path.Combine(dataDir, "Data");
            var compactPath = Path.Combine(dataDir, "Data.Compact");
            JET_INSTANCE compactInstance;
            Api.JetCreateInstance(out compactInstance, Path.Combine(dataDir, Guid.NewGuid().ToString()));
            Api.JetSetSystemParameter(compactInstance, JET_SESID.Nil, JET_param.EnableIndexChecking, 0, null);
            const int JET_paramEnableIndexCleanup = 54;

            Api.JetSetSystemParameter(compactInstance, JET_SESID.Nil, (JET_param)JET_paramEnableIndexCleanup, 0, null);
            Api.JetInit(ref compactInstance);
            using (var session = new Session(compactInstance))
            {
                Api.JetAttachDatabase(session, src, AttachDatabaseGrbit.None);
                try
                {
                    Api.JetCompact(session, src, compactPath, null, null,
                        CompactGrbit.None);
                }
                catch (Exception e)
                {
                    Console.WriteLine(e);
                }
                finally
                {
                    Api.JetDetachDatabase(session, src);
                }
            }

And the error is file in use

Program.cs - https://drive.google.com/file/d/0B-GYDT6Flp-sc3FLby1WRlhXVHNRbEtZNFlGc2ZWbEM5ZUZ3/view?usp=sharing

a.imnotazip - https://drive.google.com/file/d/0B-GYDT6Flp-scnB5NVg2Q3FlMHluaGdIclg5dEZTUTM3NTBv/view?usp=sharing