Skip to content

Commit

Permalink
Merge branch 'apache:2.x' into 2.x_readonly
Browse files Browse the repository at this point in the history
  • Loading branch information
slievrly authored Feb 18, 2024
2 parents 8e6c01e + f80a0fa commit 0e730c5
Show file tree
Hide file tree
Showing 47 changed files with 2,805 additions and 59 deletions.
1 change: 1 addition & 0 deletions changes/en-us/2.0.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,7 @@ The version is updated as follows:
- [[#5959](https://github.com/seata/seata/pull/5959)] modify code style and remove unused import
- [[#6002](https://github.com/seata/seata/pull/6002)] remove fst serialization
- [[#6045](https://github.com/seata/seata/pull/6045)] optimize derivative product check base on mysql
- [[#6342](https://github.com/seata/seata/pull/6342)] compatible with integration-tx-api module

### security:
- [[#5642](https://github.com/seata/seata/pull/5642)] add Hessian Serializer WhiteDenyList
Expand Down
4 changes: 4 additions & 0 deletions changes/en-us/2.x.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,13 @@ Add changes here for all PR submitted to the 2.x branch.
- [[#6301](https://github.com/apache/incubator-seata/pull/6301)] upgrade console frontend dependencies and supported nodejs versions
- [[#6301](https://github.com/apache/incubator-seata/pull/6312)] add saga related io.seata compatible api
- [[#6313](https://github.com/apache/incubator-seata/pull/6313)] console display the version number
- [[#6327](https://github.com/apache/incubator-seata/pull/6327)] compatible with integration.http and integration.http.Jakarta
- [[#6328](https://github.com/apache/incubator-seata/pull/6328)] compatible with integration.grpc
- [[#6330](https://github.com/apache/incubator-seata/pull/6330)] remove mariadb API
- [[#6329](https://github.com/apache/incubator-seata/pull/6312)] add saga subcomponent-level io.seata compatible api
- [[#6254](https://github.com/apache/incubator-seata/pull/6254)] optimize Hessian Serialize
- [[#6332](https://github.com/apache/incubator-seata/pull/6332)] remove mysql dependency from the distribution package
- [[#6343](https://github.com/apache/incubator-seata/pull/6343)] compatible with tm module and rm-datasource module

### security:
- [[#6069](https://github.com/apache/incubator-seata/pull/6069)] Upgrade Guava dependencies to fix security vulnerabilities
Expand Down
2 changes: 2 additions & 0 deletions changes/zh-cn/2.0.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,8 @@ Seata 是一款开源的分布式事务解决方案,提供高性能和简单
- [[#5959](https://github.com/seata/seata/pull/5959)] 修正代码风格问题及去除无用的类引用
- [[#6002](https://github.com/seata/seata/pull/6002)] 移除fst序列化模块
- [[#6045](https://github.com/seata/seata/pull/6045)] 优化MySQL衍生数据库判断逻辑
- [[#6342](https://github.com/seata/seata/pull/6342)] 兼容integration-tx-api模块



### security:
Expand Down
4 changes: 4 additions & 0 deletions changes/zh-cn/2.x.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,13 @@
- [[#6301](https://github.com/apache/incubator-seata/pull/6301)] 升级console前端依赖及支持的nodejs版本
- [[#6301](https://github.com/apache/incubator-seata/pull/6312)] 添加saga相关的io.seata兼容性API
- [[#6313](https://github.com/apache/incubator-seata/pull/6313)] console展示版本号
- [[#6327](https://github.com/apache/incubator-seata/pull/6327)] 兼容 integration.http 和 integration.http.Jakarta API
- [[#6328](https://github.com/apache/incubator-seata/pull/6328)] 兼容 integration.grpc API
- [[#6330](https://github.com/apache/incubator-seata/pull/6330)] 去除 mariadb API
- [[#6329](https://github.com/apache/incubator-seata/pull/6312)] 添加saga子组件的io.seata兼容性API
- [[#6254](https://github.com/apache/incubator-seata/pull/6254)] 优化Hessian 序列化
- [[#6332](https://github.com/apache/incubator-seata/pull/6332)] 分发包中移除 mysql 依赖
- [[#6343](https://github.com/apache/incubator-seata/pull/6343)] 兼容tm 模块和rm-datasource模块


### security:
Expand Down
44 changes: 44 additions & 0 deletions compatible/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -49,5 +49,49 @@
<version>2.1.0-SNAPSHOT</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.apache.seata</groupId>
<artifactId>seata-http</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.apache.seata</groupId>
<artifactId>seata-http-jakarta</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
<version>4.5.13</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-webmvc</artifactId>
<version>5.3.20</version>
</dependency>
<dependency>
<groupId>org.apache.seata</groupId>
<artifactId>seata-grpc</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>io.grpc</groupId>
<artifactId>grpc-stub</artifactId>
<version>1.27.1</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.apache.seata</groupId>
<artifactId>seata-rm-datasource</artifactId>
<version>2.1.0-SNAPSHOT</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.apache.seata</groupId>
<artifactId>seata-integration-tx-api</artifactId>
<version>2.1.0-SNAPSHOT</version>
<scope>compile</scope>
</dependency>
</dependencies>
</project>
28 changes: 28 additions & 0 deletions compatible/src/main/java/io/seata/common/LockStrategyMode.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
/*
* 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.common;

public enum LockStrategyMode {
/**
* Optimistic lock mode is recommended when resources are not reused in the current global transaction.
*/
OPTIMISTIC,
/**
* Pessimistic lock mode is recommended when there may be repeated use of the same resource in a global transaction.
*/
PESSIMISTIC
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
/*
* 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.core.exception;


/**
* The type Transaction exception.
*/
public class TransactionException extends org.apache.seata.core.exception.TransactionException {

private static org.apache.seata.core.exception.TransactionExceptionCode convertApacheSeataTransactionExceptionCode(TransactionExceptionCode transactionExceptionCode) {
return org.apache.seata.core.exception.TransactionExceptionCode.get(transactionExceptionCode.ordinal());
}

public TransactionException(TransactionExceptionCode code) {
super(convertApacheSeataTransactionExceptionCode(code));
}

public TransactionException(TransactionExceptionCode code, Throwable cause) {
super(convertApacheSeataTransactionExceptionCode(code), cause);
}

public TransactionException(String message) {
super(message);
}

public TransactionException(TransactionExceptionCode code, String message) {
super(convertApacheSeataTransactionExceptionCode(code), message);
}

public TransactionException(Throwable cause) {
super(cause);
}

public TransactionException(String message, Throwable cause) {
super(message, cause);
}

public TransactionException(TransactionExceptionCode code, String message, Throwable cause) {
super(convertApacheSeataTransactionExceptionCode(code), message, cause);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,172 @@
/*
* 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.core.exception;

/**
* The enum Transaction exception code.
*
*/
public enum TransactionExceptionCode {

/**
* Unknown transaction exception code.
*/
Unknown,

/**
* BeginFailed
*/
BeginFailed,

/**
* Lock key conflict transaction exception code.
*/
LockKeyConflict,

/**
* Io transaction exception code.
*/
IO,

/**
* Branch rollback failed retriable transaction exception code.
*/
BranchRollbackFailed_Retriable,

/**
* Branch rollback failed unretriable transaction exception code.
*/
BranchRollbackFailed_Unretriable,

/**
* Branch register failed transaction exception code.
*/
BranchRegisterFailed,

/**
* Branch report failed transaction exception code.
*/
BranchReportFailed,

/**
* Lockable check failed transaction exception code.
*/
LockableCheckFailed,

/**
* Branch transaction not exist transaction exception code.
*/
BranchTransactionNotExist,

/**
* Global transaction not exist transaction exception code.
*/
GlobalTransactionNotExist,

/**
* Global transaction not active transaction exception code.
*/
GlobalTransactionNotActive,

/**
* Global transaction status invalid transaction exception code.
*/
GlobalTransactionStatusInvalid,

/**
* Failed to send branch commit request transaction exception code.
*/
FailedToSendBranchCommitRequest,

/**
* Failed to send branch rollback request transaction exception code.
*/
FailedToSendBranchRollbackRequest,

/**
* Failed to add branch transaction exception code.
*/
FailedToAddBranch,

/**
* Failed to lock global transaction exception code.
*/
FailedLockGlobalTranscation,

/**
* FailedWriteSession
*/
FailedWriteSession,

/**
* Failed to store exception code
*/
FailedStore,

/**
* not raft leader exception code
*/
NotRaftLeader,

/**
* Lock key conflict fail fast transaction exception code.
*/
LockKeyConflictFailFast,

/**
* transaction already timeout
*/
TransactionTimeout,

/**
* Commit heuristic transaction exception code.
*/
CommitHeuristic,

/**
* Broken transaction exception code.
*/
Broken;


/**
* Get transaction exception code.
*
* @param ordinal the ordinal
* @return the transaction exception code
*/
public static TransactionExceptionCode get(byte ordinal) {
return get((int)ordinal);
}

/**
* Get transaction exception code.
*
* @param ordinal the ordinal
* @return the transaction exception code
*/
public static TransactionExceptionCode get(int ordinal) {
TransactionExceptionCode value = null;
try {
value = TransactionExceptionCode.values()[ordinal];
} catch (Exception e) {
throw new IllegalArgumentException("Unknown TransactionExceptionCode[" + ordinal + "]");
}
return value;
}

}
Loading

0 comments on commit 0e730c5

Please sign in to comment.