You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by GitBox <gi...@apache.org> on 2021/03/26 12:31:18 UTC
[GitHub] [shardingsphere] medoer opened a new issue #9841: Distributed transaction with seata AT throw a NullPoint Exceptoin
medoer opened a new issue #9841:
URL: https://github.com/apache/shardingsphere/issues/9841
## seata:1.4.1 & sharding 4.1.1
### dependencies
spring-cloud-alibaba-seata for web interceptor
sharding-transaction-base-seata-at
seata-spring-boot-starter
sharding-jdbc-spring-boot-starter
###
use @Transactional and @ShardingTransactionType(TransactionType.BASE)
2021-03-26 20:23:42.260 [http-nio-19010-exec-1] ERROR o.s.jdbc.datasource.DataSourceTransactionManager - [doRollbackOnCommitException : 905] - Commit exception overridden by rollback exception
java.lang.NullPointerException: null
at org.apache.shardingsphere.transaction.base.seata.at.SeataATShardingTransactionManager.commit(SeataATShardingTransactionManager.java:110)
##
get seata GlobalTransaction instance return NULL when commit
--
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [shardingsphere] medoer commented on issue #9841: Distributed transaction with seata AT throw a NullPoint Exceptoin
Posted by GitBox <gi...@apache.org>.
medoer commented on issue #9841:
URL: https://github.com/apache/shardingsphere/issues/9841#issuecomment-808186534
add web mvc interceptor SeataHandlerInterceptor to pass the seata xid, Is there another way?
--
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [shardingsphere] medoer commented on issue #9841: Distributed transaction with seata AT throw a NullPoint Exceptoin
Posted by GitBox <gi...@apache.org>.
medoer commented on issue #9841:
URL: https://github.com/apache/shardingsphere/issues/9841#issuecomment-808179967
And use seata @GlobalTransactional can rollback success, but must add
`TransactionTypeHolder.set(TransactionType.BASE)` before every persistent SQL. AND `TransactionTypeHolder.get()` return 'LOCAL'
--
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [shardingsphere] medoer commented on issue #9841: Distributed transaction with seata AT throw a NullPoint Exceptoin
Posted by GitBox <gi...@apache.org>.
medoer commented on issue #9841:
URL: https://github.com/apache/shardingsphere/issues/9841#issuecomment-808212229
![image](https://user-images.githubusercontent.com/20471718/112637664-5c8f1500-8e79-11eb-89c2-de86875f7f70.png)
How can i pass the seata xid AND GlobalTransaction
--
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [shardingsphere] medoer edited a comment on issue #9841: Distributed transaction with seata AT throw a NullPoint Exceptoin
Posted by GitBox <gi...@apache.org>.
medoer edited a comment on issue #9841:
URL: https://github.com/apache/shardingsphere/issues/9841#issuecomment-808675296
```java
Service A
@Transactional
@ShardingTransactionType(TransactionType.BASE)
public void test() {
// invoke Service B method
bFeginClient.test();
a.insert();
throw a exception();
}
Service B
// @Transactional // producer service no @Transactional annotation
@ShardingTransactionType(TransactionType.BASE)
public void test() {
b.insert();
}
```
code like this the transactional is working, both service transaction is rollback.
but service b get transaction type is 'LOCAL'
Not working for TransactionType.XA with Transaction Type
--
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [shardingsphere] medoer edited a comment on issue #9841: Distributed transaction with seata AT throw a NullPoint Exceptoin
Posted by GitBox <gi...@apache.org>.
medoer edited a comment on issue #9841:
URL: https://github.com/apache/shardingsphere/issues/9841#issuecomment-808675296
```java
Service A
@Transactional
@ShardingTransactionType(TransactionType.BASE)
public void test() {
// invoke Service B method
bFeginClient.test();
a.insert();
throw a exception();
}
Service B
// @Transactional // producer service no @Transactional annotation
@ShardingTransactionType(TransactionType.BASE)
public void test() {
b.insert();
}
```
code like this the transactional is working, both service transaction is rollback.
but service b get transaction type is 'LOCAL'
--
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [shardingsphere] medoer edited a comment on issue #9841: Distributed transaction with seata AT throw a NullPoint Exceptoin
Posted by GitBox <gi...@apache.org>.
medoer edited a comment on issue #9841:
URL: https://github.com/apache/shardingsphere/issues/9841#issuecomment-809325783
It's working when using the seata with the 1.3.0 version.
only TransactionType.BASE.
not working for TransactionType.XA
--
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [shardingsphere] terrymanu commented on issue #9841: Distributed transaction with seata AT throw a NullPoint Exceptoin
Posted by GitBox <gi...@apache.org>.
terrymanu commented on issue #9841:
URL: https://github.com/apache/shardingsphere/issues/9841#issuecomment-927254848
The seata version of ShardingSphere is 1.0.0, it is better to upgrade the version, please see #12739.
--
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-unsubscribe@shardingsphere.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [shardingsphere] medoer commented on issue #9841: Distributed transaction with seata AT throw a NullPoint Exceptoin
Posted by GitBox <gi...@apache.org>.
medoer commented on issue #9841:
URL: https://github.com/apache/shardingsphere/issues/9841#issuecomment-809325783
It's working when using the seata with the 1.3.0 version.
--
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [shardingsphere] medoer edited a comment on issue #9841: Distributed transaction with seata AT throw a NullPoint Exceptoin
Posted by GitBox <gi...@apache.org>.
medoer edited a comment on issue #9841:
URL: https://github.com/apache/shardingsphere/issues/9841#issuecomment-808675296
```java
Service A
@Transactional
@ShardingTransactionType(TransactionType.BASE)
public void test() {
// invoke Service B method
bFeginClient.test();
a.insert();
throw a exception();
}
Service B
// @Transactional // producer service no @Transactional annotation
@ShardingTransactionType(TransactionType.BASE)
public void test() {
b.insert();
}
```
code like this the transactional is working, both service transaction is rollback.
but service b get transaction type is 'LOCAL'
Not working for TransactionType.XA
--
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [shardingsphere] medoer commented on issue #9841: Distributed transaction with seata AT throw a NullPoint Exceptoin
Posted by GitBox <gi...@apache.org>.
medoer commented on issue #9841:
URL: https://github.com/apache/shardingsphere/issues/9841#issuecomment-808675296
```java
Service A
@Transactional
@ShardingTransactionType(TransactionType.BASE)
public void test() {
bFeginClient.test();
a.insert();
throw a exception();
}
Service B
// @Transactional // producer service no @Transactional annotation
@ShardingTransactionType(TransactionType.BASE)
public void test() {
b.insert();
}
```
code like this the transactional is working, both service transaction is rollback.
but service b get transaction type is 'LOCAL'
--
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [shardingsphere] medoer edited a comment on issue #9841: Distributed transaction with seata AT throw a NullPoint Exceptoin
Posted by GitBox <gi...@apache.org>.
medoer edited a comment on issue #9841:
URL: https://github.com/apache/shardingsphere/issues/9841#issuecomment-808179967
And use seata @GlobalTransactional can rollback success, but must add
`TransactionTypeHolder.set(TransactionType.BASE)` before every persistent SQL. AND `TransactionTypeHolder.get()` return 'LOCAL'
AND this way didn't use SeataATShardingTransactionManager#commit
--
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [shardingsphere] terrymanu closed issue #9841: Distributed transaction with seata AT throw a NullPoint Exceptoin
Posted by GitBox <gi...@apache.org>.
terrymanu closed issue #9841:
URL: https://github.com/apache/shardingsphere/issues/9841
--
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-unsubscribe@shardingsphere.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org