File tree Expand file tree Collapse file tree 1 file changed +3
-4
lines changed
java-datastore/google-cloud-datastore/src/main/java/com/google/cloud/datastore Expand file tree Collapse file tree 1 file changed +3
-4
lines changed Original file line number Diff line number Diff line change @@ -216,7 +216,7 @@ public T call() throws DatastoreException {
216216 // or from `transaction.commit()`. If there is an exception thrown from either call site,
217217 // then the transaction is still active. Check if it is still active (e.g. not commited)
218218 // and roll back the transaction.
219- if (transaction != null && transaction .isActive ()) {
219+ if (transaction .isActive ()) {
220220 transaction .rollback ();
221221 }
222222 throw DatastoreException .propagateUserException (ex );
@@ -225,11 +225,10 @@ public T call() throws DatastoreException {
225225 // If the transaction is active, then commit the rollback. If it was already successfully
226226 // rolled back, the transaction is inactive (prevents rolling back an already rolled back
227227 // transaction).
228- if (transaction != null && transaction .isActive ()) {
228+ if (transaction .isActive ()) {
229229 transaction .rollback ();
230230 }
231- if (transaction != null
232- && options != null
231+ if (options != null
233232 && options .getModeCase ().equals (TransactionOptions .ModeCase .READ_WRITE )) {
234233 setPrevTransactionId (transaction .getTransactionId ());
235234 }
You can’t perform that action at this time.
0 commit comments