Beispiel #1
0
 public void Commit()
 {
     try
     {
         Model.Flush();
         _readWriteTransaction.Commit();
         Model.CurrentTransaction = null;
     }
     finally
     {
         InTransaction = false;
     }
 }
Beispiel #2
0
 public int AddShapeGeometry(XbimShapeGeometry shapeGeometry)
 {
     lock (_shapeGeometryCursor)
     {
         SetGeometryContext();
         try
         {
             long remainder = _geometryCount % TransactionBatchSize; //pulse transactions
             if (remainder == TransactionBatchSize - 1)
             {
                 _shapeGeometryTransaction.Commit();
                 _shapeGeometryTransaction.Begin();
             }
             _geometryCount++;
             return(_shapeGeometryCursor.AddGeometry(shapeGeometry));
         }
         finally
         {
             ResetGeometryContext();
         }
     }
 }
Beispiel #3
0
 public int AddShapeInstance(XbimShapeInstance shapeInstance, int geometryId)
 {
     lock (_shapeInstanceCursor)
     {
         SetInstanceContext();
         try
         {
             long remainder = _instanceCount % TransactionBatchSize; //pulse transactions
             if (remainder == TransactionBatchSize - 1)
             {
                 _shapeInstanceTransaction.Commit();
                 _shapeInstanceTransaction.Begin();
             }
             _instanceCount++;
             shapeInstance.ShapeGeometryLabel = geometryId;
             return(_shapeInstanceCursor.AddInstance(shapeInstance));
         }
         finally
         {
             ResetInstanceContext();
         }
     }
 }