|
39 | 39 | import java.util.concurrent.TimeoutException;
|
40 | 40 |
|
41 | 41 | /**
|
42 |
| - * The type Default transaction manager. |
| 42 | + * Default implementation of Transaction Manager (TM) in Seata distributed transaction system. |
43 | 43 | *
|
| 44 | + * <p>Acts as the primary client-side component for managing global transactions. |
| 45 | + * Forwards transaction management operations to Transaction Coordinator (TC) server |
| 46 | + * through network communication.</p> |
| 47 | + * |
| 48 | + * <p><b>Core Operations:</b></p> |
| 49 | + * <ul> |
| 50 | + * <li><b>Begin</b>: Request new global transaction and receive XID</li> |
| 51 | + * <li><b>Commit</b>: Initiate two-phase commit protocol</li> |
| 52 | + * <li><b>Rollback</b>: Request global transaction rollback</li> |
| 53 | + * <li><b>Status Query</b>: Retrieve current transaction status</li> |
| 54 | + * <li><b>Status Report</b>: Report transaction status changes</li> |
| 55 | + * </ul> |
| 56 | + * |
| 57 | + * <p><b>Communication:</b> Uses Netty-based TCP communication with configurable |
| 58 | + * serialization, connection pooling, and automatic failover to available TC servers.</p> |
| 59 | + * |
| 60 | + * <p><b>Usage Example:</b></p> |
| 61 | + * <pre>{@code |
| 62 | + * TransactionManager tm = new DefaultTransactionManager(); |
| 63 | + * try { |
| 64 | + * String xid = tm.begin("app-id", "service-group", "order-create", 30000); |
| 65 | + * // Execute business logic... |
| 66 | + * GlobalStatus status = tm.commit(xid); |
| 67 | + * } catch (TransactionException e) { |
| 68 | + * tm.rollback(xid); |
| 69 | + * throw e; |
| 70 | + * } |
| 71 | + * }</pre> |
| 72 | + * |
| 73 | + * <p>Thread-safe and typically used indirectly through {@link org.apache.seata.tm.api.DefaultGlobalTransaction} |
| 74 | + * or {@link org.apache.seata.tm.api.TransactionalTemplate}.</p> |
| 75 | + * |
| 76 | + * @author Seata Team |
| 77 | + * @see TransactionManager |
| 78 | + * @see TmNettyRemotingClient |
| 79 | + * @see org.apache.seata.tm.api.DefaultGlobalTransaction |
| 80 | + * @since 1.0.0 |
44 | 81 | */
|
45 | 82 | public class DefaultTransactionManager implements TransactionManager {
|
46 | 83 |
|
|
0 commit comments