Skip to content

Commit

Permalink
code review
Browse files Browse the repository at this point in the history
  • Loading branch information
XingY committed Jan 15, 2024
1 parent 586ea4d commit a4976f2
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions query/src/org/labkey/query/controllers/QueryController.java
Original file line number Diff line number Diff line change
Expand Up @@ -4435,6 +4435,11 @@ protected String getTargetContainerProp()
}

protected JSONObject executeJson(JSONObject json, CommandType commandType, boolean allowTransaction, Errors errors) throws Exception
{
return executeJson(json, commandType, allowTransaction, errors, false);
}

protected JSONObject executeJson(JSONObject json, CommandType commandType, boolean allowTransaction, Errors errors, boolean isNestedTransaction) throws Exception
{
JSONObject response = new JSONObject();
Container container = getContainerForCommand(json);
Expand Down Expand Up @@ -4548,9 +4553,9 @@ protected JSONObject executeJson(JSONObject json, CommandType commandType, boole
{
if (behaviorType != null && behaviorType != AuditBehaviorType.NONE)
{
DbScope.Transaction auditTransaction = transacted ? transaction : table.getSchema().getScope().getCurrentTransaction();
DbScope.Transaction auditTransaction = !transacted && isNestedTransaction ? table.getSchema().getScope().getCurrentTransaction() : transaction;
if (auditTransaction == null)
auditTransaction = transaction;
auditTransaction = NO_OP_TRANSACTION;

if (auditTransaction.getAuditEvent() != null)
auditEvent = auditTransaction.getAuditEvent();
Expand Down Expand Up @@ -4980,7 +4985,7 @@ else if (scope != tableInfo.getSchema().getScope())
}
commandObject.put("extraContext", commandExtraContext);

JSONObject commandResponse = executeJson(commandObject, command, !transacted, errors);
JSONObject commandResponse = executeJson(commandObject, command, !transacted, errors, transacted);
// Bail out immediately if we're going to return a failure-type response message
if (commandResponse == null || (errors.hasErrors() && !isSuccessOnValidationError()))
return null;
Expand Down

0 comments on commit a4976f2

Please sign in to comment.