Exemplo n.º 1
0
        private TransactionToApply MockedTransaction()
        {
            TransactionRepresentation transaction = mock(typeof(TransactionRepresentation));

            when(transaction.AdditionalHeader()).thenReturn(new sbyte[0]);
            return(new TransactionToApply(transaction));
        }
Exemplo n.º 2
0
        public override Response <long> Commit(RequestContext context, TransactionRepresentation tx)
        {
            Serializer          serializer   = new Protocol.TransactionSerializer(tx);
            Deserializer <long> deserializer = (buffer, temporaryBuffer) => buffer.readLong();

            return(SendRequest(_requestTypes.type(HaRequestTypes_Type.Commit), context, serializer, deserializer));
        }
Exemplo n.º 3
0
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
//ORIGINAL LINE: private static void writeTx(org.neo4j.storageengine.api.WritableChannel writableChannel, org.neo4j.kernel.impl.transaction.TransactionRepresentation tx) throws java.io.IOException
        private static void WriteTx(WritableChannel writableChannel, TransactionRepresentation tx)
        {
            ReplicatedTransactionFactory.TransactionRepresentationWriter txWriter = transactionalRepresentationWriter(tx);
            while (txWriter.CanWrite())
            {
                txWriter.Write(writableChannel);
            }
        }
Exemplo n.º 4
0
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
//ORIGINAL LINE: public boolean visit(org.neo4j.kernel.impl.transaction.CommittedTransactionRepresentation transaction) throws Exception
            public override bool Visit(CommittedTransactionRepresentation transaction)
            {
                TransactionRepresentation txRepresentation = transaction.TransactionRepresentation;
                long txId             = transaction.CommitEntry.TxId;
                TransactionToApply tx = new TransactionToApply(txRepresentation, txId);

                tx.Commitment(NO_COMMITMENT, txId);
                tx.LogPosition(transaction.StartEntry.StartPosition);
                StorageEngine.apply(tx, Mode);
                return(false);
            }
Exemplo n.º 5
0
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
//ORIGINAL LINE: public long commit(org.neo4j.kernel.impl.api.TransactionToApply batch, org.neo4j.kernel.impl.transaction.tracing.CommitEvent commitEvent, org.neo4j.storageengine.api.TransactionApplicationMode mode) throws org.neo4j.internal.kernel.api.exceptions.TransactionFailureException
        public override long Commit(TransactionToApply batch, CommitEvent commitEvent, TransactionApplicationMode mode)
        {
            if (batch.Next() != null)
            {
                throw new System.ArgumentException("Only supports single-commit on slave --> master");
            }

            try
            {
                TransactionRepresentation representation = batch.TransactionRepresentation();
                RequestContext            context        = _requestContextFactory.newRequestContext(representation.LockSessionId);
                using (Response <long> response = _master.commit(context, representation))
                {
                    return(response.ResponseConflict());
                }
            }
            catch (ComException e)
            {
                throw new TransientTransactionFailureException("Cannot commit this transaction on the master. " + "The master is either down, or we have network connectivity problems.", e);
            }
        }
Exemplo n.º 6
0
		 internal TransactionRepresentationReplicatedTransaction( TransactionRepresentation tx )
		 {
			  this._tx = tx;
		 }
Exemplo n.º 7
0
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
//ORIGINAL LINE: public long applyPreparedTransaction(org.neo4j.kernel.impl.transaction.TransactionRepresentation preparedTransaction) throws org.neo4j.internal.kernel.api.exceptions.TransactionFailureException
        public override long ApplyPreparedTransaction(TransactionRepresentation preparedTransaction)
        {
            return(_transactionCommitProcess.commit(new TransactionToApply(preparedTransaction), CommitEvent.NULL, TransactionApplicationMode.EXTERNAL));
        }
Exemplo n.º 8
0
 public TransactionToApplyAnonymousInnerClass(BatchingResponseHandler outerInstance, Org.Neo4j.Kernel.impl.transaction.TransactionRepresentation getTransactionRepresentation, Org.Neo4j.Io.pagecache.tracing.cursor.context.VersionContext getVersionContext) : base(getTransactionRepresentation, transaction.CommitEntry.TxId, getVersionContext)
 {
     this.outerInstance = outerInstance;
 }