WangzJi commented on code in PR #7443:
URL: https://github.com/apache/incubator-seata/pull/7443#discussion_r2151232529


##########
common/src/main/java/org/apache/seata/common/transaction/api/TransactionParticipant.java:
##########
@@ -0,0 +1,41 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.seata.common.transaction.api;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Inherited;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+/**
+ * Transaction Participant annotation.
+ * A general annotation for marking beans that participate in distributed 
transactions.
+ * This annotation is designed to replace the specific usage of @LocalTCC in 
Saga scenarios
+ * to avoid confusion, while also being applicable to TCC and other 
transaction modes.
+ * <p>
+ * In distributed transaction terminology, a "participant" is any component 
that takes part
+ * in the transaction protocol, making this name semantically accurate across 
different
+ * transaction patterns (TCC, Saga, XA, etc.).
+ * 
+ * @see org.apache.seata.rm.tcc.api.LocalTCC // the original TCC-specific 
annotation, still supported for backward compatibility
+ */
+@Retention(RetentionPolicy.RUNTIME)
+@Target(ElementType.TYPE)
+@Inherited
+public @interface TransactionParticipant {

Review Comment:
   @funky-eyes, thanks for your review! I'd like to address your concerns:
   
   **Regarding " it is only applied in the TCC and SAGA annotation modes":**
   
   The  annotation aims to solve this limitation by being more generic. Here 
are the location options:
   
   **Option A: Current location** `common/transaction/api`
   - ✅ Generic design - not limited to specific transaction modes  
   - ✅ Future extensibility for other transaction patterns
   - ✅ Resolves the scope limitation you mentioned
   
   **Option B: More focused location** `integration-tx-api/annotation`
   - ✅ Co-located with other transaction annotations like `AspectTransactional`
   - ✅ More focused on annotation-based transaction integration
   - ✅ Still maintains proper module dependencies
   
   **Regarding the naming:** 
   How about `LocalTransactionResource` provides clearer semantics than 
`TransactionParticipant`:
   - "Local" - clearly indicates it's for local (non-remote) resources
   - "TransactionResource" - directly relates to its functionality
   - Avoids the ambiguity you pointed out
   
   Which approach do you prefer? Or do you have other suggestions for the 
design?



-- 
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: notifications-unsubscr...@seata.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscr...@seata.apache.org
For additional commands, e-mail: notifications-h...@seata.apache.org

Reply via email to