Skip to content

Commit

Permalink
Move markNotQueryOnly() into init transaction methods of PersistRequest
Browse files Browse the repository at this point in the history
  • Loading branch information
rbygrave committed Oct 18, 2024
1 parent a452fc0 commit 6ceea85
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -146,12 +146,6 @@ int executeStatement(boolean addBatch) {
public void initTransIfRequired() {
createImplicitTransIfRequired();
persistCascade = transaction.isPersistCascade();
}

/**
* Mark the underlying transaction as not being query only.
*/
public void markNotQueryOnly() {
transaction.markNotQueryOnly();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,7 @@ public void initTransIfRequiredWithBatchCascade() {
docStoreMode = calcDocStoreMode(transaction, type);
}
checkBatchEscalationOnCascade();
transaction.markNotQueryOnly();
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,6 @@ public int executeOrmUpdate(Update<?> update, Transaction t) {
private int executeOrQueue(PersistRequest request) {
try {
request.initTransIfRequired();
request.markNotQueryOnly();
int rc = request.executeOrQueue();
request.commitTransIfRequired();
return rc;
Expand Down Expand Up @@ -384,7 +383,6 @@ public void update(EntityBean entityBean, Transaction t) {
req.checkDraft();
try {
req.initTransIfRequiredWithBatchCascade();
req.markNotQueryOnly();
if (req.isReference()) {
// its a reference so see if there are manys to save...
if (req.isPersistCascade()) {
Expand Down Expand Up @@ -432,7 +430,6 @@ public void insert(EntityBean bean, InsertOptions insertOptions, Transaction t)
}
try {
req.initTransIfRequiredWithBatchCascade();
req.markNotQueryOnly();
insert(req);
req.resetDepth();
req.commitTransIfRequired();
Expand Down Expand Up @@ -565,7 +562,6 @@ private int deleteRequest(PersistRequestBean<?> req, PersistRequestBean<?> draft
}
try {
req.initTransIfRequiredWithBatchCascade();
req.markNotQueryOnly();
int rows = delete(req);
if (draftReq != null) {
// delete the 'draft' bean ('live' bean deleted first)
Expand Down

0 comments on commit 6ceea85

Please sign in to comment.