@Override public long advanceTransactionNumber() { return clientSession.getServerSession().advanceTransactionNumber(); }
@Override public void startTransaction(final TransactionOptions transactionOptions) { notNull("transactionOptions", transactionOptions); if (transactionState == TransactionState.IN) { throw new IllegalStateException("Transaction already in progress"); } if (transactionState == TransactionState.COMMITTED) { cleanupTransaction(TransactionState.IN); } else { transactionState = TransactionState.IN; } getServerSession().advanceTransactionNumber(); this.transactionOptions = TransactionOptions.merge(transactionOptions, getOptions().getDefaultTransactionOptions()); WriteConcern writeConcern = this.transactionOptions.getWriteConcern(); if (writeConcern == null) { throw new MongoInternalException("Invariant violated. Transaction options write concern can not be null"); } if (!writeConcern.isAcknowledged()) { throw new MongoClientException("Transactions do not support unacknowledged write concern"); } }
@Override public long advanceTransactionNumber() { return clientSession.getServerSession().advanceTransactionNumber(); }
@Override public void startTransaction(final TransactionOptions transactionOptions) { notNull("transactionOptions", transactionOptions); if (transactionState == TransactionState.IN) { throw new IllegalStateException("Transaction already in progress"); } if (transactionState == TransactionState.COMMITTED) { cleanupTransaction(TransactionState.IN); } else { transactionState = TransactionState.IN; } getServerSession().advanceTransactionNumber(); this.transactionOptions = TransactionOptions.merge(transactionOptions, getOptions().getDefaultTransactionOptions()); WriteConcern writeConcern = this.transactionOptions.getWriteConcern(); if (writeConcern == null) { throw new MongoInternalException("Invariant violated. Transaction options write concern can not be null"); } if (!writeConcern.isAcknowledged()) { throw new MongoClientException("Transactions do not support unacknowledged write concern"); } }
@Override public void startTransaction(final TransactionOptions transactionOptions) { notNull("transactionOptions", transactionOptions); if (transactionState == TransactionState.IN) { throw new IllegalStateException("Transaction already in progress"); } if (transactionState == TransactionState.COMMITTED) { cleanupTransaction(TransactionState.IN); } else { transactionState = TransactionState.IN; } getServerSession().advanceTransactionNumber(); this.transactionOptions = TransactionOptions.merge(transactionOptions, getOptions().getDefaultTransactionOptions()); WriteConcern writeConcern = this.transactionOptions.getWriteConcern(); if (writeConcern == null) { throw new MongoInternalException("Invariant violated. Transaction options write concern can not be null"); } if (!writeConcern.isAcknowledged()) { throw new MongoClientException("Transactions do not support unacknowledged write concern"); } }