slievrly commented on code in PR #6342: URL: https://github.com/apache/incubator-seata/pull/6342#discussion_r1490942276
########## compatible/src/main/java/io/seata/spring/annotation/GlobalTransactional.java: ########## @@ -0,0 +1,121 @@ +/* + * 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 io.seata.spring.annotation; + +import org.apache.seata.common.DefaultValues; +import org.apache.seata.common.LockStrategyMode; +import org.apache.seata.tm.api.transaction.Propagation; + +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; + + +@Retention(RetentionPolicy.RUNTIME) +@Target({ElementType.METHOD, ElementType.TYPE}) +@Inherited +public @interface GlobalTransactional { + + /** + * Global transaction timeoutMills in MILLISECONDS. + * If client.tm.default-global-transaction-timeout is configured, It will replace the DefaultValues + * .DEFAULT_GLOBAL_TRANSACTION_TIMEOUT. + * + * @return timeoutMills in MILLISECONDS. + */ + int timeoutMills() default DefaultValues.DEFAULT_GLOBAL_TRANSACTION_TIMEOUT; + + /** + * Given name of the global transaction instance. + * + * @return Given name. + */ + String name() default ""; + + /** + * roll back for the Class + * + * @return the class array of the rollback for + */ + Class<? extends Throwable>[] rollbackFor() default {}; + + /** + * roll back for the class name + * + * @return the class name of rollback for + */ + String[] rollbackForClassName() default {}; + + /** + * not roll back for the Class + * + * @return the class array of no rollback for + */ + Class<? extends Throwable>[] noRollbackFor() default {}; + + /** + * not roll back for the class name + * + * @return string [ ] + */ + String[] noRollbackForClassName() default {}; + + /** + * the propagation of the global transaction + * + * @return propagation + */ + Propagation propagation() default Propagation.REQUIRED; Review Comment: 'Propagation' should belong to the io.seata.xx package. If the user defines this parameter in the annotation parameter, 'Propagation' cannot be found because the location of the package changes. ########## compatible/src/main/java/io/seata/spring/annotation/GlobalTransactional.java: ########## @@ -0,0 +1,121 @@ +/* + * 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 io.seata.spring.annotation; + +import org.apache.seata.common.DefaultValues; +import org.apache.seata.common.LockStrategyMode; +import org.apache.seata.tm.api.transaction.Propagation; + +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; + + +@Retention(RetentionPolicy.RUNTIME) +@Target({ElementType.METHOD, ElementType.TYPE}) +@Inherited +public @interface GlobalTransactional { + + /** + * Global transaction timeoutMills in MILLISECONDS. + * If client.tm.default-global-transaction-timeout is configured, It will replace the DefaultValues + * .DEFAULT_GLOBAL_TRANSACTION_TIMEOUT. + * + * @return timeoutMills in MILLISECONDS. + */ + int timeoutMills() default DefaultValues.DEFAULT_GLOBAL_TRANSACTION_TIMEOUT; + + /** + * Given name of the global transaction instance. + * + * @return Given name. + */ + String name() default ""; + + /** + * roll back for the Class + * + * @return the class array of the rollback for + */ + Class<? extends Throwable>[] rollbackFor() default {}; + + /** + * roll back for the class name + * + * @return the class name of rollback for + */ + String[] rollbackForClassName() default {}; + + /** + * not roll back for the Class + * + * @return the class array of no rollback for + */ + Class<? extends Throwable>[] noRollbackFor() default {}; + + /** + * not roll back for the class name + * + * @return string [ ] + */ + String[] noRollbackForClassName() default {}; + + /** + * the propagation of the global transaction + * + * @return propagation + */ + Propagation propagation() default Propagation.REQUIRED; + + /** + * customized global lock retry interval(unit: ms) + * you may use this to override global config of "client.rm.lock.retryInterval" + * note: 0 or negative number will take no effect(which mean fall back to global config) + * + * @return int + */ + int lockRetryInterval() default 0; + + /** + * customized global lock retry interval(unit: ms) + * you may use this to override global config of "client.rm.lock.retryInterval" + * note: 0 or negative number will take no effect(which mean fall back to global config) + * + * @return int + */ + @Deprecated + int lockRetryInternal() default 0; + + /** + * customized global lock retry times + * you may use this to override global config of "client.rm.lock.retryTimes" + * note: negative number will take no effect(which mean fall back to global config) + * + * @return int + */ + int lockRetryTimes() default -1; + + /** + * pick the Acquire lock policy + * + * @return lock strategy mode + */ + LockStrategyMode lockStrategyMode() default LockStrategyMode.PESSIMISTIC; Review Comment: same above. -- 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]
