Example #1
0
        /// <summary>
        /// Perform a snapshot backup using the W2K3 abort API.
        /// </summary>
        private void SnapshotBackupServer2003Apis()
        {
            using (var instance = this.CreateInstance())
            {
                instance.Init();
                using (var session = new Session(instance))
                {
                    Api.JetAttachDatabase(session, this.database, AttachDatabaseGrbit.None);
                    JET_DBID dbid;
                    Api.JetOpenDatabase(session, this.database, string.Empty, out dbid, OpenDatabaseGrbit.None);

                    JET_OSSNAPID snapshot;
                    Api.JetOSSnapshotPrepare(out snapshot, SnapshotPrepareGrbit.CopySnapshot);
                    int numInstances;
                    JET_INSTANCE_INFO[] instances;
                    Api.JetOSSnapshotFreeze(snapshot, out numInstances, out instances, SnapshotFreezeGrbit.None);

                    Server2003Api.JetOSSnapshotAbort(snapshot, SnapshotAbortGrbit.None);
                }
            }
        }
        public void TestJetUpdate2()
        {
            if (!EsentVersion.SupportsServer2003Features)
            {
                return;
            }

            JET_COLUMNID columnid = this.columnDict["Int32"];
            int value = Any.Int32;

            using (var trx = new Transaction(this.session))
            {
                Api.JetPrepareUpdate(this.session, this.tableid, JET_prep.Insert);
                Api.SetColumn(this.session, this.tableid, columnid, value);
                int ignored;
                Server2003Api.JetUpdate2(this.session, this.tableid, null, 0, out ignored, UpdateGrbit.None);
                trx.Commit(CommitTransactionGrbit.None);
            }

            Api.TryMoveFirst(this.session, this.tableid);
            Assert.AreEqual(value, Api.RetrieveColumnAsInt32(this.session, this.tableid, columnid));
        }
Example #3
0
        public void VerifyXpThrowsExceptionOnJetUpdate2()
        {
            int actual;

            Server2003Api.JetUpdate2(JET_SESID.Nil, JET_TABLEID.Nil, null, 0, out actual, UpdateGrbit.None);
        }
Example #4
0
 public void VerifyXpThrowsExceptionOnJetOSSnapshotAbort()
 {
     Server2003Api.JetOSSnapshotAbort(JET_OSSNAPID.Nil, SnapshotAbortGrbit.None);
 }