Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

limit并行异常 #209

Closed
hanahmily opened this issue Dec 15, 2016 · 1 comment
Closed

limit并行异常 #209

hanahmily opened this issue Dec 15, 2016 · 1 comment

Comments

@hanahmily
Copy link
Contributor

并行执行limit查询,会出现数据异常

问题复现步骤:

  1. 并行执行多个limit查询

期望的表现:

每个查询可以正常返回

观察到的表现:

出现IndexOutOfBoundsException

Sharding-JDBC版本: 1.4.0
操作系统及版本: OS X

hanahmily pushed a commit that referenced this issue Dec 15, 2016
@zhaoxp1
Copy link

zhaoxp1 commented Feb 13, 2017

线下环境20个线程,单机执行了下,没有问题,但是生产环境有下面的异常,问下是同一个问题引发的吗?(注:使用Sharding-JDBC版本: 1.4.0)

SQL: select id, sid, car_type, city_id, user_id, outer_id, point_type, point, used_point, status, exp_date, outer_str_id, ext, modify_version, create_time, update_time from t_driver_score_log where sid = ? order by create_time desc limit ?,?

Cause: java.lang.IndexOutOfBoundsException: Index: 1, Size: 1

at   org.apache.ibatis.exceptions.ExceptionFactory.wrapException(ExceptionFactory.java:30)
at   org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:122)
at   org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:113)
at   sun.reflect.GeneratedMethodAccessor72.invoke(Unknown   Source)
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:358)
...   47   more

Caused by: java.lang.IndexOutOfBoundsException: Index: 1, Size: 1
at java.util.ArrayList.rangeCheck(ArrayList.java:653)
at java.util.ArrayList.get(ArrayList.java:429)
at com.dangdang.ddframe.rdb.jdbc.util.ParameterList.set(ParameterList.java:74)
at com.dangdang.ddframe.rdb.parser.result.merger.Limit.replaceParameters(Limit.java:56)
at com.dangdang.ddframe.rdb.router.SQLRouteEngine.routeSQL(SQLRouteEngine.java:90)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants