Details
-
Bug
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Not a Bug
-
3.0.3
-
None
Description
We recently migrated our DB server from Mysql to MariaDB.
After this migration,
not always but sometimes the error(socket was closed by server) is occurred by our program executing select query.
That select query gets result set (300000~600000 records).
The code worked fine with mysql connector/J (8.0.27).
<Before Migration>
mysql : 5.7.25
mysql connector/J : 8.0.27
wait_timeout : 28800
fetchSize=MIN_VALUE
<After Migration>
mariadb : 10.5.12 (Galera Cluster has proxysql)
mariadb connector/J : 3.0.3
wait_timeout : 600
fetchSize=1
usePipelineAuth=false
<MyBatix option>
resultSetType=FORWARD_ONLY
useCache=false
flushCache=true
Caused by: org.apache.ibatis.exceptions.PersistenceException:
###Error querying database. Cause: java.sql.SQLNonTransientConnectionException: (conn=596012) Error while streaming resultSet data
###Cause: java.sql.SQLNonTransientConnectionException: (conn=596012) Error while streaming resultSet data
at org.apache.ibatis.exceptions.ExceptionFactory.wrapException(ExceptionFactory.java:23)
at org.apache.ibatis.session.defaults.DefaultSqlSession.select(DefaultSqlSession.java:126)
at org.apache.ibatis.session.defaults.DefaultSqlSession.select(DefaultSqlSession.java:114)
at jp.co.rakuten.dbi.mybatis.MyBatisDBPreparedQuery.query(MyBatisDBPreparedQuery.java:57)
... 6 more
Caused by: java.sql.SQLNonTransientConnectionException: (conn=596012) Error while streaming resultSet data
at org.mariadb.jdbc.export.ExceptionFactory.createException(ExceptionFactory.java:281)
at org.mariadb.jdbc.export.ExceptionFactory.create(ExceptionFactory.java:347)
at org.mariadb.jdbc.client.result.StreamingResult.addStreamingValue(StreamingResult.java:130)
at org.mariadb.jdbc.client.result.StreamingResult.nextStreamingValue(StreamingResult.java:113)
at org.mariadb.jdbc.client.result.StreamingResult.next(StreamingResult.java:163)
at net.sf.log4jdbc.ResultSetSpy.next(ResultSetSpy.java:1882)
at org.apache.ibatis.executor.resultset.FastResultSetHandler.shouldProcessMoreRows(FastResultSetHandler.java:232)
at org.apache.ibatis.executor.resultset.FastResultSetHandler.handleRowValues(FastResultSetHandler.java:219)
at org.apache.ibatis.executor.resultset.FastResultSetHandler.handleResultSet(FastResultSetHandler.java:196)
at org.apache.ibatis.executor.resultset.FastResultSetHandler.handleResultSets(FastResultSetHandler.java:159)
at org.apache.ibatis.executor.statement.PreparedStatementHandler.query(PreparedStatementHandler.java:57)
at org.apache.ibatis.executor.statement.RoutingStatementHandler.query(RoutingStatementHandler.java:70)
at org.apache.ibatis.executor.SimpleExecutor.doQuery(SimpleExecutor.java:57)
at org.apache.ibatis.executor.BaseExecutor.queryFromDatabase(BaseExecutor.java:259)
at org.apache.ibatis.executor.BaseExecutor.query(BaseExecutor.java:132)
at org.apache.ibatis.executor.CachingExecutor.query(CachingExecutor.java:105)
at org.apache.ibatis.executor.CachingExecutor.query(CachingExecutor.java:81)
at org.apache.ibatis.session.defaults.DefaultSqlSession.select(DefaultSqlSession.java:124)
... 8 more
Caused by: java.io.EOFException: unexpected end of stream, read 123 bytes from 197 (socket was closed by server)
at org.mariadb.jdbc.client.socket.impl.PacketReader.readPacket(PacketReader.java:107)
at org.mariadb.jdbc.client.result.Result.readNext(Result.java:156)
at org.mariadb.jdbc.client.result.StreamingResult.addStreamingValue(StreamingResult.java:124)
... 23 more