mybatis+druid+oracle偶尔出现ORA-01013: 用户请求取消当前的操作,有人遇到过吗?
t1647 2019-06-11 09:31:15 具体错误如下:
### Error querying database. Cause: java.sql.SQLException: ORA-01013: 用户请求取消当前的操作
### The error may exist in file [E:\xxxx\xxxxxx\target\classes\mapper\CityMapper.xml]
### The error may involve defaultParameterMap
### The error occurred while setting parameters
### SQL: select geomstr from city
### Cause: java.sql.SQLException: ORA-01013: 用户请求取消当前的操作
; uncategorized SQLException; SQL state [72000]; error code [1013]; ORA-01013: 用户请求取消当前的操作
; nested exception is java.sql.SQLException: ORA-01013: 用户请求取消当前的操作
] with root cause
java.sql.SQLException: ORA-01013: 用户请求取消当前的操作
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:112) ~[ojdbc14-10.2.0.4.0.jar:Oracle JDBC Driver version - "10.2.0.4.0"]
at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:331) ~[ojdbc14-10.2.0.4.0.jar:Oracle JDBC Driver version - "10.2.0.4.0"]
at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:288) ~[ojdbc14-10.2.0.4.0.jar:Oracle JDBC Driver version - "10.2.0.4.0"]
at oracle.jdbc.driver.T4C8Oall.receive(T4C8Oall.java:745) ~[ojdbc14-10.2.0.4.0.jar:Oracle JDBC Driver version - "10.2.0.4.0"]
at oracle.jdbc.driver.T4CPreparedStatement.doOall8(T4CPreparedStatement.java:219) ~[ojdbc14-10.2.0.4.0.jar:Oracle JDBC Driver version - "10.2.0.4.0"]
at oracle.jdbc.driver.T4CPreparedStatement.executeForDescribe(T4CPreparedStatement.java:813) ~[ojdbc14-10.2.0.4.0.jar:Oracle JDBC Driver version - "10.2.0.4.0"]
at oracle.jdbc.driver.OracleStatement.executeMaybeDescribe(OracleStatement.java:1049) ~[ojdbc14-10.2.0.4.0.jar:Oracle JDBC Driver version - "10.2.0.4.0"]
at oracle.jdbc.driver.T4CPreparedStatement.executeMaybeDescribe(T4CPreparedStatement.java:854) ~[ojdbc14-10.2.0.4.0.jar:Oracle JDBC Driver version - "10.2.0.4.0"]
at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1146) ~[ojdbc14-10.2.0.4.0.jar:Oracle JDBC Driver version - "10.2.0.4.0"]
at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:3370) ~[ojdbc14-10.2.0.4.0.jar:Oracle JDBC Driver version - "10.2.0.4.0"]
at oracle.jdbc.driver.OraclePreparedStatement.execute(OraclePreparedStatement.java:3476) ~[ojdbc14-10.2.0.4.0.jar:Oracle JDBC Driver version - "10.2.0.4.0"]
at com.alibaba.druid.filter.FilterChainImpl.preparedStatement_execute(FilterChainImpl.java:3409) ~[druid-1.1.14.jar:1.1.14]
at com.alibaba.druid.wall.WallFilter.preparedStatement_execute(WallFilter.java:627) ~[druid-1.1.14.jar:1.1.14]
at com.alibaba.druid.filter.FilterChainImpl.preparedStatement_execute(FilterChainImpl.java:3407) ~[druid-1.1.14.jar:1.1.14]
at com.alibaba.druid.proxy.jdbc.PreparedStatementProxyImpl.execute(PreparedStatementProxyImpl.java:167) ~[druid-1.1.14.jar:1.1.14]
at com.alibaba.druid.pool.DruidPooledPreparedStatement.execute(DruidPooledPreparedStatement.java:497) ~[druid-1.1.14.jar:1.1.14]
at org.apache.ibatis.executor.statement.PreparedStatementHandler.query(PreparedStatementHandler.java:64) ~[mybatis-3.5.1.jar:3.5.1]
at org.apache.ibatis.executor.statement.RoutingStatementHandler.query(RoutingStatementHandler.java:79) ~[mybatis-3.5.1.jar:3.5.1]
at org.apache.ibatis.executor.SimpleExecutor.doQuery(SimpleExecutor.java:63) ~[mybatis-3.5.1.jar:3.5.1]
at org.apache.ibatis.executor.BaseExecutor.queryFromDatabase(BaseExecutor.java:324) ~[mybatis-3.5.1.jar:3.5.1]
at org.apache.ibatis.executor.BaseExecutor.query(BaseExecutor.java:156) ~[mybatis-3.5.1.jar:3.5.1]
at org.apache.ibatis.executor.CachingExecutor.query(CachingExecutor.java:109) ~[mybatis-3.5.1.jar:3.5.1]
at org.apache.ibatis.executor.CachingExecutor.query(CachingExecutor.java:83) ~[mybatis-3.5.1.jar:3.5.1]
at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:147) ~[mybatis-3.5.1.jar:3.5.1]
at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:140) ~[mybatis-3.5.1.jar:3.5.1]
at org.apache.ibatis.session.defaults.DefaultSqlSession.selectOne(DefaultSqlSession.java:76) ~[mybatis-3.5.1.jar:3.5.1]
at sun.reflect.GeneratedMethodAccessor71.invoke(Unknown Source) ~[na:na]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_60]
at java.lang.reflect.Method.invoke(Method.java:497) ~[na:1.8.0_60]
at org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:433) ~[mybatis-spring-2.0.1.jar:2.0.1]
at com.sun.proxy.$Proxy58.selectOne(Unknown Source) ~[na:na]
at org.mybatis.spring.SqlSessionTemplate.selectOne(SqlSessionTemplate.java:166) ~[mybatis-spring-2.0.1.jar:2.0.1]
at org.apache.ibatis.binding.MapperMethod.execute(MapperMethod.java:87) ~[mybatis-3.5.1.jar:3.5.1]
at org.apache.ibatis.binding.MapperProxy.invoke(MapperProxy.java:58) ~[mybatis-3.5.1.jar:3.5.1]
at com.sun.proxy.$Proxy73.getCityGeomStr(Unknown Source) ~[na:na]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_60]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_60]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_60]
at java.lang.reflect.Method.invoke(Method.java:497) ~[na:1.8.0_60]
at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:343) ~[spring-aop-5.1.6.RELEASE.jar:5.1.6.RELEASE]
at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:198) ~[spring-aop-5.1.6.RELEASE.jar:5.1.6.RELEASE]
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163) ~[spring-aop-5.1.6.RELEASE.jar:5.1.6.RELEASE]
at org.springframework.dao.support.PersistenceExceptionTranslationInterceptor.invoke(PersistenceExceptionTranslationInterceptor.java:139) ~[spring-tx-5.1.6.RELEASE.jar:5.1.6.RELEASE]
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186) ~[spring-aop-5.1.6.RELEASE.jar:5.1.6.RELEASE]
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:212) ~[spring-aop-5.1.6.RELEASE.jar:5.1.6.RELEASE]
at com.sun.proxy.$Proxy74.getCityGeomStr(Unknown Source) ~[na:na]
各软件版本如下
springboot 2.1.4;mybatis-starter 2.0.1 ;druid 1.1.14;oracle 11.2.0.1.0 ;jdbc版本为ojdbc14 10.2.0.4.0
偶尔报错,错误出现一次,立刻刷新再重新请求就不会报错;一段时间不用,再执行请求的时候就又报这个错误。
所有sql均为查询语句,不涉及修改,删除、更新等操作。
具体配置如下:
spring:
datasource:
name: orcl
platform: oracle
type: com.alibaba.druid.pool.DruidDataSource
druid:
driver-class-name: oracle.jdbc.driver.OracleDriver
url: jdbc:oracle:thin:@xxx.xxx.xxx.xxx:1521/oracle
username: admin
password: 123456
#配置初始化大小
initial-size: 5
min-idle: 3
max-active: 20
#获取连接等待超时时间 单位ms
max-wait: 60000
#间隔多久进行一次检测,检测需要关闭的空闲连接 单位ms 60s
time-between-eviction-runs-millis: 60000
#一个连接在池中最小生存的时间 300s
min-evictable-idle-time-millis: 300000
#检测链接是否有效
validation-query: SELECT 1 FROM dual
test-while-idle: true
test-on-borrow: false
test-on-return: false
#打开PSCache,并指定每个连接上PSCache的大小。oracle设为true,mysql设为false。
pool-prepared-statements: true
max-pool-prepared-statement-per-connection-size: 20
mybatis:
#指定mybatis的主配置文件的位置
mapper-locations: classpath:mapper/*Mapper.xml
#给实体类起别名(默认只是首字母小写而已)
type-aliases-package: cn.smartgis.bigDataMapService.entity
#配置sql超时时间(60s)
configuration:
default-statement-timeout: 300