apache / apache/incubator-seata

Oracle数据库使用seata db模式,开启GlobalTransactional注解后,报该表无index索引异常

Open
#3,283 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
26k
Forks
8.8k
Avg merge
1d 8h
Merged PRs (30d)
4

Description

- [ ] I have searched the [issues](https://github.com/seata/seata/issues) of this repository and believe that this is not a duplicate.

### Ⅰ. Issue Description
环境:
seata-server 1.4,
seata-springboot-starter 1.4
Oracle数据库使用seata db模式,开启GlobalTransactional注解后,报该表无index索引异常,建立主键索引后,又报违反唯一性约束异常

### Ⅱ. Describe what happened

Caused by: io.seata.common.exception.ShouldNeverHappenException: [xid:192.168.43.239:8091:71244368354144256]get tablemeta failed
at io.seata.rm.datasource.sql.struct.cache.AbstractTableMetaCache.getTableMeta(AbstractTableMetaCache.java:69)
at io.seata.rm.datasource.AbstractConnectionProxy.prepareStatement(AbstractConnectionProxy.java:116)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.apache.ibatis.logging.jdbc.ConnectionLogger.invoke(ConnectionLogger.java:55)
at com.sun.proxy.$Proxy128.prepareStatement(Unknown Source)
at org.apache.ibatis.executor.statement.PreparedStatementHandler.instantiateStatement(PreparedStatementHandler.java:86)
at org.apache.ibatis.executor.statement.BaseStatementHandler.prepare(BaseStatementHandler.java:88)
... 60 more

Caused by: org.apache.ibatis.executor.ExecutorException: Error preparing statement. Cause: io.seata.common.exception.ShouldNeverHappenException: [xid:192.168.43.239:8091:71244368354144256]get tablemeta failed

2 ERROR [http-nio-9001-exec-1]o.a.c.c.C.[.[.[.[dispatcherServlet] - Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request processing failed; nested exception is java.lang.RuntimeException: org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.executor.ExecutorException: Error preparing statement. Cause: io.seata.common.exception.ShouldNeverHappenException: [xid:192.168.43.239:8091:71244368354144256]get tablemeta failed
org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.executor.ExecutorException: Error preparing statement. Cause: io.seata.common.exception.ShouldNeverHappenException: [xid:192.168.43.239:8091:71244368354144256]get tablemeta failed
at org.mybatis.spring.MyBatisExceptionTranslator.translateExceptionIfPossible(MyBatisExceptionTranslator.java:78)

Caused by: java.sql.SQLIntegrityConstraintViolationException: ORA-00001: 违反唯一约束条件 (ZHLUB.SYS_C0066343)

### The error may exist in file [/Users/ys/Desktop/live/live-stream/live-stream-goods/target/classes/mybatis/GoodsMapper.xml]
### The error may involve com.zhlub.live.stream.goods.repository.IGoodsMapper.insertTest-Inline
### The error occurred while setting parameters
### SQL: insert into LIVE_GOODS_SERVICE_TEST(GOOD_NAME, GOOD_ADDR) values (8016202903968333824, 8016202903968333824)
### Cause: java.sql.SQLIntegrityConstraintViolationException: ORA-00001: 违反唯一约束条件 (ZHLUB.SYS_C0066343)

; ORA-00001: 违反唯一约束条件 (ZHLUB.SYS_C0066343)
; nested exception is java.sql.SQLIntegrityConstraintViolationException: ORA-00001: 违反唯一约束条件 (ZHLUB.SYS_C0066343)

### Ⅲ. Describe what you expected to happen
我想在db模式下使用oracle做事务管理

### Ⅳ. How to reproduce it (as minimally and precisely as possible)

1. xxx
2. xxx
3. xxx

### Ⅴ. Anything else we need to know?

### Ⅵ. Environment:

- JDK version : 1.8
- OS : Mac os
- Others:

Contributor guide

Open the contributing guide

Research direction

Start with AbstractTableMetaCache.java:69 and AbstractConnectionProxy.java:116 to trace the reported table-metadata failure. Review the Oracle-related database behavior described in the issue, then inspect GoodsMapper.xml and IGoodsMapper.insertTest for the failing insert. Done means a reproducible Oracle DB-mode case is identified and the transaction succeeds without the reported metadata or constraint errors.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, sql
Domain
databases, distributed-systems
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.