*
* @return A new snapshot
*/
- protected abstract DataTreeSnapshot getSnapshot();
+ protected abstract DataTreeSnapshot getSnapshot(Object transactionId);
}
private static final class Idle extends State {
}
@Override
- protected DataTreeSnapshot getSnapshot() {
+ protected DataTreeSnapshot getSnapshot(Object transactionId) {
return chain.takeSnapshot();
}
}
}
@Override
- protected DataTreeSnapshot getSnapshot() {
+ protected DataTreeSnapshot getSnapshot(Object transactionId) {
final DataTreeSnapshot ret = snapshot;
- Preconditions.checkState(ret != null, "Previous transaction %s is not ready yet", transaction.getIdentifier());
+ Preconditions.checkState(ret != null, "Could not get snapshot for transaction %s - previous transaction %s is not ready yet",
+ transactionId, transaction.getIdentifier());
return ret;
}
}
@Override
- protected DataTreeSnapshot getSnapshot() {
+ protected DataTreeSnapshot getSnapshot(Object transactionId) {
throw new IllegalStateException(message);
}
}
state = idleState;
}
- private Entry<State, DataTreeSnapshot> getSnapshot() {
+ private Entry<State, DataTreeSnapshot> getSnapshot(T transactionId) {
final State localState = state;
- return new SimpleEntry<>(localState, localState.getSnapshot());
+ return new SimpleEntry<>(localState, localState.getSnapshot(transactionId));
}
private boolean recordTransaction(final State expected, final DOMStoreWriteTransaction transaction) {
}
protected DOMStoreReadTransaction newReadOnlyTransaction(T transactionId) {
- final Entry<State, DataTreeSnapshot> entry = getSnapshot();
+ final Entry<State, DataTreeSnapshot> entry = getSnapshot(transactionId);
return SnapshotBackedTransactions.newReadTransaction(transactionId, getDebugTransactions(), entry.getValue());
}
DOMStoreReadWriteTransaction ret;
do {
- entry = getSnapshot();
+ entry = getSnapshot(transactionId);
ret = new SnapshotBackedReadWriteTransaction<T>(transactionId, getDebugTransactions(), entry.getValue(), this);
} while (!recordTransaction(entry.getKey(), ret));
DOMStoreWriteTransaction ret;
do {
- entry = getSnapshot();
+ entry = getSnapshot(transactionId);
ret = new SnapshotBackedWriteTransaction<T>(transactionId, getDebugTransactions(), entry.getValue(), this);
} while (!recordTransaction(entry.getKey(), ret));