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 2020/12/16 03:13:50 UTC

[GitHub] [shardingsphere] Kimisme opened a new issue #8639: The problem of oracle sequence recognition into table

Kimisme opened a new issue #8639:
URL: https://github.com/apache/shardingsphere/issues/8639


   ### Dependence
   
   ```xml
           <dependency>
               <groupId>com.oracle.database.jdbc</groupId>
               <artifactId>ojdbc8</artifactId>
               <version>12.2.0.1</version>
           </dependency>
                <dependency>
               <groupId>org.apache.shardingsphere</groupId>
               <artifactId>shardingsphere-jdbc-core</artifactId>
               <version>5.0.0-alpha</version>
           </dependency>
   ```
   
   ### Execute sql
   
   ```sql
    SELECT JS_SERV_TYPE_TMP_SEQ.NEXTVAL FROM dual 
   ```
   
   ### Sql description
   
   - JS_SERV_TYPE_TMP_SEQ is a sequence, not a table
   - dual is a keyword, not a table
   
   
   ### Execute error report
   
   ```
   11:08:59.524 [main] DEBUG org.mybatis.spring.SqlSessionUtils - Creating a new SqlSession
   11:08:59.530 [main] DEBUG org.mybatis.spring.SqlSessionUtils - SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@38883a31] was not registered for synchronization because synchronization is not active
   11:08:59.548 [main] DEBUG org.springframework.jdbc.datasource.DataSourceUtils - Fetching JDBC Connection from DataSource
   11:08:59.548 [main] DEBUG org.mybatis.spring.transaction.SpringManagedTransaction - JDBC Connection [org.apache.shardingsphere.driver.jdbc.core.connection.ShardingSphereConnection@73893ec1] will not be managed by Spring
   11:08:59.588 [main] DEBUG ServTypeTmp.insert!selectKey - ==>  Preparing: SELECT JS_SERV_TYPE_TMP_SEQ.NEXTVAL FROM dual 
   11:08:59.998 [main] DEBUG ServTypeTmp.insert!selectKey - ==> Parameters: 
   11:09:03.781 [main] DEBUG org.mybatis.spring.SqlSessionUtils - Closing non transactional SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@38883a31]
   11:09:03.782 [main] DEBUG org.springframework.jdbc.datasource.DataSourceUtils - Returning JDBC Connection to DataSource
   Exception in thread "main" org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.executor.ExecutorException: Error selecting key or setting result to parameter object. Cause: org.apache.shardingsphere.infra.exception.ShardingSphereException: Can not route tables for `[dual, JS_SERV_TYPE_TMP_SEQ]`, please make sure the tables are in same schema.
   	at org.mybatis.spring.MyBatisExceptionTranslator.translateExceptionIfPossible(MyBatisExceptionTranslator.java:73)
   	at org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:365)
   	at com.sun.proxy.$Proxy31.insert(Unknown Source)
   	at org.mybatis.spring.SqlSessionTemplate.insert(SqlSessionTemplate.java:237)
   	at com.xxx.mybatis.dao.base.BaseDaoImpl.create(BaseDaoImpl.java:72)
   	at com.xxx.mybatis.dao.ServTypeTmpDAOImpl.createServTypeTmpOK(ServTypeTmpDAOImpl.java:20)
   	at com.xxx.mybatis.ShardingJdbcProgram.main(ShardingJdbcProgram.java:50)
   Caused by: org.apache.ibatis.executor.ExecutorException: Error selecting key or setting result to parameter object. Cause: org.apache.shardingsphere.infra.exception.ShardingSphereException: Can not route tables for `[dual, JS_SERV_TYPE_TMP_SEQ]`, please make sure the tables are in same schema.
   	at org.apache.ibatis.executor.keygen.SelectKeyGenerator.processGeneratedKeys(SelectKeyGenerator.java:92)
   	at org.apache.ibatis.executor.keygen.SelectKeyGenerator.processBefore(SelectKeyGenerator.java:47)
   	at org.apache.ibatis.executor.statement.BaseStatementHandler.generateKeys(BaseStatementHandler.java:140)
   	at org.apache.ibatis.executor.statement.BaseStatementHandler.<init>(BaseStatementHandler.java:63)
   	at org.apache.ibatis.executor.statement.PreparedStatementHandler.<init>(PreparedStatementHandler.java:39)
   	at org.apache.ibatis.executor.statement.RoutingStatementHandler.<init>(RoutingStatementHandler.java:45)
   	at org.apache.ibatis.session.Configuration.newStatementHandler(Configuration.java:502)
   	at org.apache.ibatis.executor.SimpleExecutor.doUpdate(SimpleExecutor.java:47)
   	at org.apache.ibatis.executor.BaseExecutor.update(BaseExecutor.java:115)
   	at org.apache.ibatis.executor.CachingExecutor.update(CachingExecutor.java:75)
   	at org.apache.ibatis.session.defaults.DefaultSqlSession.update(DefaultSqlSession.java:170)
   	at org.apache.ibatis.session.defaults.DefaultSqlSession.insert(DefaultSqlSession.java:157)
   	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.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:355)
   	... 5 more
   Caused by: org.apache.shardingsphere.infra.exception.ShardingSphereException: Can not route tables for `[dual, JS_SERV_TYPE_TMP_SEQ]`, please make sure the tables are in same schema.
   	at org.apache.shardingsphere.sharding.route.engine.type.unconfigured.ShardingUnconfiguredTablesRoutingEngine.route(ShardingUnconfiguredTablesRoutingEngine.java:55)
   	at org.apache.shardingsphere.sharding.route.engine.ShardingSQLRouter.createRouteContext(ShardingSQLRouter.java:70)
   	at org.apache.shardingsphere.sharding.route.engine.ShardingSQLRouter.createRouteContext(ShardingSQLRouter.java:55)
   	at org.apache.shardingsphere.infra.route.engine.impl.PartialSQLRouteExecutor.route(PartialSQLRouteExecutor.java:59)
   	at org.apache.shardingsphere.infra.route.engine.SQLRouteEngine.route(SQLRouteEngine.java:57)
   	at org.apache.shardingsphere.infra.context.kernel.KernelProcessor.generateExecutionContext(KernelProcessor.java:52)
   	at org.apache.shardingsphere.driver.jdbc.core.statement.ShardingSpherePreparedStatement.createExecutionContext(ShardingSpherePreparedStatement.java:266)
   	at org.apache.shardingsphere.driver.jdbc.core.statement.ShardingSpherePreparedStatement.execute(ShardingSpherePreparedStatement.java:198)
   	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.PreparedStatementLogger.invoke(PreparedStatementLogger.java:59)
   	at com.sun.proxy.$Proxy35.execute(Unknown Source)
   	at org.apache.ibatis.executor.statement.PreparedStatementHandler.query(PreparedStatementHandler.java:62)
   	at org.apache.ibatis.executor.statement.RoutingStatementHandler.query(RoutingStatementHandler.java:78)
   	at org.apache.ibatis.executor.SimpleExecutor.doQuery(SimpleExecutor.java:62)
   	at org.apache.ibatis.executor.BaseExecutor.queryFromDatabase(BaseExecutor.java:303)
   	at org.apache.ibatis.executor.BaseExecutor.query(BaseExecutor.java:154)
   	at org.apache.ibatis.executor.CachingExecutor.query(CachingExecutor.java:102)
   	at org.apache.ibatis.executor.CachingExecutor.query(CachingExecutor.java:82)
   	at org.apache.ibatis.executor.keygen.SelectKeyGenerator.processGeneratedKeys(SelectKeyGenerator.java:68)
   	... 21 more
   ```
   
   


----------------------------------------------------------------
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] menghaoranss commented on issue #8639: The problem of oracle sequence recognition into table

Posted by GitBox <gi...@apache.org>.
menghaoranss commented on issue #8639:
URL: https://github.com/apache/shardingsphere/issues/8639#issuecomment-747187146


   Duplicate with #8607 


----------------------------------------------------------------
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] menghaoranss closed issue #8639: The problem of oracle sequence recognition into table

Posted by GitBox <gi...@apache.org>.
menghaoranss closed issue #8639:
URL: https://github.com/apache/shardingsphere/issues/8639


   


----------------------------------------------------------------
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