Пример #1
0
        public XbimReadWriteTransaction BeginTransaction(string operationName)
        {
            if (InverseCache != null)
            {
                throw new XbimException("Transaction can't be open when cache is in operation.");
            }

            if (_editTransactionEntityCursor != null)
            {
                throw new XbimException("Attempt to begin another transaction whilst one is already running");
            }
            try
            {
                //check if write permission upgrade is required
                _editTransactionEntityCursor = InstanceCache.GetWriteableEntityTable();
                InstanceCache.BeginCaching();
                var txn = new XbimReadWriteTransaction(this, _editTransactionEntityCursor.BeginLazyTransaction(), operationName);
                CurrentTransaction = txn;
                return(txn);
            }
            catch (Exception e)
            {
                throw new XbimException("Failed to create ReadWrite transaction", e);
            }
        }
Пример #2
0
 /// <summary>
 /// Inserts a deep copy of the toCopy object into this model
 /// All property values are copied to the maximum depth
 /// Inverse properties are not copied
 /// </summary>
 /// <param name="toCopy">Instance to copy</param>
 /// <param name="mappings">Supply a dictionary of mappings if repeat copy insertions are to be made</param>
 /// <param name="txn"></param>
 /// <param name="includeInverses"></param>
 /// <returns></returns>
 public T InsertCopy <T>(T toCopy, XbimInstanceHandleMap mappings, XbimReadWriteTransaction txn, bool includeInverses = false) where T : IPersistEntity
 {
     return(Cache.InsertCopy(toCopy, mappings, txn, includeInverses));
 }
Пример #3
0
 public T InsertCopy <T>(T toCopy, XbimInstanceHandleMap mappings, XbimReadWriteTransaction txn, PropertyTranformDelegate propTransform, bool includeInverses = false) where T : IPersistEntity
 {
     return(Cache.InsertCopy(toCopy, mappings, txn, includeInverses, propTransform));
 }