gongycn commented on PR #6629: URL: https://github.com/apache/incubator-seata/pull/6629#issuecomment-2185863608
> > > 我们是否可以将sql进行解析,如果这个sql是select类型的sql,就不进行xa相关的事务动作? Can we parse the SQL statement to skip XA-related transaction actions if the SQL is of type SELECT? > > > > > > Simple branch logic composed of basic SQL can be implemented this way, but consideration is needed if the transaction involves more complex scenarios such as calling stored procedures under XA branch transactions. The business logic within stored procedures may not be straightforward to determine. > > Moreover, in Oracle, the prepare phase can explicitly indicate whether the branch is read-only, so it may feel unnecessary to handle it in this way. > > We currently refuse to use stored procedures directly, so I would prefer to place the XA START after the first DML action is recognized. 1. The official documentation mentions for XA use cases: `Suitable for migrating old applications to the Seata platform based on the XA protocol.`. Therefore, if stored procedures are not supported, it will not be possible to achieve this. Currently, some of our applications are using a mix of XA and TCC. 2. If the XA transaction is started only after the first DML operation, in Oracle, this can be achieved by leveraging the Promotable XA feature to ensure that the repeatable read characteristic is maintained under the Repeatable Read isolation level. Otherwise, the repeatable read cannot be guaranteed. This feature is not necessarily supported in other databases. -- 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] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
