FlyingZC commented on code in PR #20726:
URL: https://github.com/apache/shardingsphere/pull/20726#discussion_r990757221
##########
shardingsphere-proxy/shardingsphere-proxy-backend/src/main/java/org/apache/shardingsphere/proxy/backend/communication/jdbc/JDBCDatabaseCommunicationEngine.java:
##########
@@ -127,12 +133,33 @@ public ResponseHeader execute() throws SQLException {
return new
UpdateResponseHeader(executionContext.getSqlStatementContext().getSqlStatement());
}
proxySQLExecutor.checkExecutePrerequisites(executionContext);
- List result = proxySQLExecutor.execute(executionContext);
- refreshMetaData(executionContext);
- Object executeResultSample = result.iterator().next();
- return executeResultSample instanceof QueryResult
- ? processExecuteQuery(executionContext, result, (QueryResult)
executeResultSample)
- : processExecuteUpdate(executionContext, result);
+ TransactionStatus transactionStatus =
backendConnection.getConnectionSession().getTransactionStatus();
+ SQLStatement sqlStatement =
executionContext.getSqlStatementContext().getSqlStatement();
+ JDBCBackendTransactionManager transactionManager = null;
+ if (TransactionType.XA == transactionStatus.getTransactionType() &&
transactionStatus.isInTransaction()
Review Comment:
Maybe not in the transaction `!transactionStatus.isInTransaction()` and then
auto start the transaction.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]