-
Notifications
You must be signed in to change notification settings - Fork 75
Closed
Labels
api: firestoreIssues related to the googleapis/java-firestore API.Issues related to the googleapis/java-firestore API.
Description
I understand internally we use writebatch for transactions but the error messages should be related to feature. So, If I was using transactions outside the method, It throws an exception but saying writebatch has been already commited rather than saying transaction.
Environment details
- API : runTransaction
- OS type and version: windows11
- Java version: 1.8
- version(s):
Steps to reproduce
- I have added sample code, Please check to reproduce the issue
Code example
// example
public static void solve() {
// Create your client
// Firestore firestoreClient =
Transaction t = null;
try {
t = firestoreClient.runTransaction(transaction -> {
// do something
return transaction;
}).get();
t.get(firestoreClient.document("users/me"));
} catch (Exception e) {
throw new RuntimeException(e);
}
}Stack trace
java.lang.IllegalStateException: Cannot modify a WriteBatch that has already been committed. at com.google.common.base.Preconditions.checkState(Preconditions.java:502) at com.google.cloud.firestore.UpdateBuilder.verifyNotCommitted(UpdateBuilder.java:158) at com.google.cloud.firestore.UpdateBuilder.performUpdate(UpdateBuilder.java:519) at com.google.cloud.firestore.UpdateBuilder.update(UpdateBuilder.java:356)
External references such as API reference guides
Any additional information below
Metadata
Metadata
Assignees
Labels
api: firestoreIssues related to the googleapis/java-firestore API.Issues related to the googleapis/java-firestore API.