Esempio n. 1
0
		public void TryReadFutureDocument()
		{
			int transactionId = m_db.StartTransaction();
 
			DocumentId id1 = new DocumentId("1");

			// this object is stored out of transaction therefore should be visible for the transaction
			m_db.Update(id1, new byte[1] { 0 });

			byte[] blob = m_db.TransactionGet(transactionId, id1);

			Assert.IsNull(blob);

			m_db.CommitTransaction(transactionId);
		}
Esempio n. 2
0
        private void Commit()
        {
            byte[] transactionIdBytes = m_serverSocket.Receive();

            int transactionId = BitConverter.ToInt32(transactionIdBytes, 0);

            try
            {
                m_db.CommitTransaction(transactionId);
                m_serverSocket.Send(Protocol.Success);
            }
            catch (TransactionNotExistException ex)
            {
                m_serverSocket.SendMore(Protocol.Failed).Send("Transaction doesn't exist");
            }
        }