Hello team, when I test using MyBatis integrated w...
# questions-and-troubleshooting
u
Hello team, when I test using MyBatis integrated with JDBC to connect to StarRocks 3.3.14, I encounter a connection timeout error when performing batch inserts with INSERT INTO. I have set the connection timeout, socket timeout, and keep-alive time to fairly high values, such as configLocation.setDefaultStatementTimeout(180); socketTimeout=180000 & rewriteBatchedStatements=true & allowMultiQueries=true & connectTimeout=10000. However, when performing multi-threaded asynchronous batch writes, I still encounter connection timeout issues. Can someone help me? Is it a problem with my configuration, or is it related to the version? The amount of data I am inserting per batch is not large, around 100 records each time.
rg. springframework.dao.QueryTimeoutException: ## Error updating database. Cause: com.mysql.cj.jdbc.exceptions.MySQLTimeoutException: Statement cancelled due to timeout or client request ## The error may exist in class path resource [mapper/sr/MockMapper. xml] ## The error may involve defaultParameterMap ## The error occurred while setting parameters ## SQL: INSERT INTO feature_raw_results (sub_task_id, event_id, feature_name, event_type, default_value, feature_type, feature_value, source, created_at) #a Cause: com.mysal.c).jdbc. exceptions MySQl TimeoutException: Stotement cancelled due to timeout or client request Statement cancelled due to timeout or client request at org.springframework. jdbc.support.SQLExceptionSubclassTranslator.doTranslate(SQLExceptionSubclassTranslator.java: 83) at org.springframework. jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java: 107) at org.springframework. jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:116) at org.mybatis.spring.MyBatisExceptionTranslator.translateExceptionIfPossible(MyBatisExceptionTranslator.java:92) at org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java: 439) at jdk.proxy2/jdk.proxy2.$Proxy96.insert(Unknown Source) at org.mybatis.spring.SqlSessionTemplate.insert(SqlSessionTemplate.java:272) at org.apache.ibatis.binding.MapperMethod.execute(MapperMethod.java: 62) at ora.apache.ibatis.bindina.MapperProxy$PlainMethodInvoker.invoke/MapperProxy. iava:141) VALUES