public static void AssertNotModifiedByAnotherTransaction(TableStorage storage, ITransactionStorageActions transactionStorageActions, string key, Table.ReadResult readResult, TransactionInformation transactionInformation) { if (readResult == null) return; var txIdAsBytes = readResult.Key.Value<byte[]>("txId"); if (txIdAsBytes == null) return; var txId = new Guid(txIdAsBytes); if (transactionInformation != null && transactionInformation.Id == txId) { return; } var existingTx = storage.Transactions.Read(new RavenJObject { { "txId", txId.ToByteArray() } }); if (existingTx == null)//probably a bug, ignoring this as not a real tx return; var timeout = existingTx.Key.Value<DateTime>("timeout"); if (SystemTime.UtcNow > timeout) { transactionStorageActions.RollbackTransaction(txId); return; } throw new ConcurrencyException("Document '" + key + "' is locked by transacton: " + txId); }
public DocumentsStorageActions(TableStorage storage, ITransactionStorageActions transactionStorageActions, IUuidGenerator generator, IEnumerable <AbstractDocumentCodec> documentCodecs) { this.storage = storage; this.transactionStorageActions = transactionStorageActions; this.generator = generator; this.documentCodecs = documentCodecs; }
public DocumentsStorageActions(TableStorage storage, ITransactionStorageActions transactionStorageActions, IUuidGenerator generator, IEnumerable<AbstractDocumentCodec> documentCodecs) { this.storage = storage; this.transactionStorageActions = transactionStorageActions; this.generator = generator; this.documentCodecs = documentCodecs; }
public DocumentsStorageActions(TableStorage storage, ITransactionStorageActions transactionStorageActions, IUuidGenerator generator, OrderedPartCollection <AbstractDocumentCodec> documentCodecs, IDocumentCacher documentCacher) { this.storage = storage; this.transactionStorageActions = transactionStorageActions; this.generator = generator; this.documentCodecs = documentCodecs; this.documentCacher = documentCacher; }
public static void AssertNotModifiedByAnotherTransaction(TableStorage storage, ITransactionStorageActions transactionStorageActions, string key, Table.ReadResult readResult, TransactionInformation transactionInformation) { if (readResult == null) { return; } var txIdAsBytes = readResult.Key.Value <byte[]>("txId"); if (txIdAsBytes == null) { return; } var txId = new Guid(txIdAsBytes); if (transactionInformation != null && transactionInformation.Id == txId) { return; } var existingTx = storage.Transactions.Read(new RavenJObject { { "txId", txId.ToByteArray() } }); if (existingTx == null)//probably a bug, ignoring this as not a real tx { return; } var timeout = existingTx.Key.Value <DateTime>("timeout"); if (DateTime.UtcNow > timeout) { transactionStorageActions.RollbackTransaction(txId); return; } throw new ConcurrencyException("Document '" + key + "' is locked by transacton: " + txId); }
public DocumentsStorageActions(TableStorage storage, ITransactionStorageActions transactionStorageActions, IUuidGenerator generator) { this.storage = storage; this.transactionStorageActions = transactionStorageActions; this.generator = generator; }
public DocumentsStorageActions(TableStorage storage, ITransactionStorageActions transactionStorageActions) { this.storage = storage; this.transactionStorageActions = transactionStorageActions; }