call request.markNotQueryOnly

This commit is contained in:
Noemi Praml
2024-10-17 16:30:42 +02:00
parent 4438d5db7d
commit a452fc0e21
2 changed files with 11 additions and 4 deletions
@@ -148,6 +148,13 @@ public abstract class PersistRequest extends BeanRequest implements BatchPostExe
persistCascade = transaction.isPersistCascade();
}
/**
* Mark the underlying transaction as not being query only.
*/
public void markNotQueryOnly() {
transaction.markNotQueryOnly();
}
/**
* Return the type of this request. One of INSERT, UPDATE, DELETE, UPDATESQL or CALLABLESQL.
*/
@@ -87,7 +87,7 @@ public final class DefaultPersister implements Persister {
private int executeOrQueue(PersistRequest request) {
try {
request.initTransIfRequired();
request.transaction().markNotQueryOnly();
request.markNotQueryOnly();
int rc = request.executeOrQueue();
request.commitTransIfRequired();
return rc;
@@ -384,7 +384,7 @@ public final class DefaultPersister implements Persister {
req.checkDraft();
try {
req.initTransIfRequiredWithBatchCascade();
req.transaction().markNotQueryOnly();
req.markNotQueryOnly();
if (req.isReference()) {
// its a reference so see if there are manys to save...
if (req.isPersistCascade()) {
@@ -432,7 +432,7 @@ public final class DefaultPersister implements Persister {
}
try {
req.initTransIfRequiredWithBatchCascade();
req.transaction().markNotQueryOnly();
req.markNotQueryOnly();
insert(req);
req.resetDepth();
req.commitTransIfRequired();
@@ -565,7 +565,7 @@ public final class DefaultPersister implements Persister {
}
try {
req.initTransIfRequiredWithBatchCascade();
req.transaction().markNotQueryOnly();
req.markNotQueryOnly();
int rows = delete(req);
if (draftReq != null) {
// delete the 'draft' bean ('live' bean deleted first)