简体   繁体   English

Spring 批量申请 sqlcode -4499 sqlstate 08001

[英]Spring Batch application sqlcode -4499 sqlstate 08001

Requirement:要求:

Read from the file containing 100K records.从包含 100K 记录的文件中读取。

For each records, retrieve data from IBM DB2 database table and then retrieve data from NuoDB database table.对于每条记录,从 IBM DB2 数据库表中检索数据,然后从 NuoDB 数据库表中检索数据。

At last, insert the updated records in the NuoDB database table.最后,在 NuoDB 数据库表中插入更新的记录。

Design approached: Chunk-oriented processing where 1000 records will be read from the file and processed and written into the database.设计方法:面向块的处理,其中 1000 条记录将从文件中读取并处理并写入数据库。

Issue: After approx 75K records and running for almost 5 hours, the batch application failed with the below error:问题:大约 75K 记录并运行近 5 小时后,批处理应用程序失败并出现以下错误:

Hibernate: select ... the SELECT query for DB2
Hibernate: select ... the SELECT query for NuoDB
2020-06-08 22:00:00.187  INFO [ ,,,] 32215 --- [       Thread-9] ConfigServletWebServerApplicationContext : Closing org.springframework.boot.web.servlet.context.AnnotationConfigServletWebServerApplicationContext@2a7f1f10: startup date [Mon Jun 08 17:22:51 BST 2020]; parent: org.springframework.context.annotation.AnnotationConfigApplicationContext@3972a855
2020-06-08 22:00:00.192  INFO [ ,,,] 32215 --- [       Thread-9] o.s.c.support.DefaultLifecycleProcessor  : Stopping beans in phase 0
2020-06-08 22:00:00.193  INFO [ ,,,] 32215 --- [       Thread-9] o.s.i.endpoint.EventDrivenConsumer       : Removing {logging-channel-adapter:_org.springframework.integration.errorLogger} as a subscriber to the 'errorChannel' channel
2020-06-08 22:00:00.193  INFO [ ,,,] 32215 --- [       Thread-9] o.s.i.channel.PublishSubscribeChannel    : Channel ' -1.errorChannel' has 0 subscriber(s).
2020-06-08 22:00:00.193  INFO [ ,,,] 32215 --- [       Thread-9] o.s.i.endpoint.EventDrivenConsumer       : stopped _org.springframework.integration.errorLogger
2020-06-08 22:00:00.195  INFO [ ,,,] 32215 --- [       Thread-9] o.s.s.c.ThreadPoolTaskScheduler          : Shutting down ExecutorService 'taskScheduler'
2020-06-08 22:00:00.196  INFO [ ,,,] 32215 --- [       Thread-9] o.s.jmx.export.MBeanExporter             : Unregistering JMX-exposed beans on shutdown
2020-06-08 22:00:00.203  INFO [ ,,,] 32215 --- [       Thread-9] j.LocalContainerEntityManagerFactoryBean : Closing JPA EntityManagerFactory for persistence unit 'default'
2020-06-08 22:00:00.203  INFO [ ,,,] 32215 --- [       Thread-9] j.LocalContainerEntityManagerFactoryBean : Closing JPA EntityManagerFactory for persistence unit 'default'
2020-06-08 22:00:00.203  INFO [ ,,,] 32215 --- [       Thread-9] j.LocalContainerEntityManagerFactoryBean : Closing JPA EntityManagerFactory for persistence unit 'default'
2020-06-08 22:00:00.203  INFO [ ,,,] 32215 --- [       Thread-9] j.LocalContainerEntityManagerFactoryBean : Closing JPA EntityManagerFactory for persistence unit 'default'
2020-06-08 22:00:00.203  INFO [ ,,,] 32215 --- [       Thread-9] com.zaxxer.hikari.HikariDataSource       : HikariPool-3 - Shutdown initiated...
2020-06-08 22:00:00.210  INFO [ ,,,] 32215 --- [       Thread-9] com.zaxxer.hikari.HikariDataSource       : HikariPool-3 - Shutdown completed.
2020-06-08 22:00:00.210  INFO [ ,,,] 32215 --- [       Thread-9] com.zaxxer.hikari.HikariDataSource       : HikariPool-2 - Shutdown initiated...
2020-06-08 22:00:00.211  INFO [ ,,,] 32215 --- [       Thread-9] com.zaxxer.hikari.HikariDataSource       : HikariPool-2 - Shutdown completed.
2020-06-08 22:00:00.212  INFO [ ,,,] 32215 --- [       Thread-9] com.zaxxer.hikari.HikariDataSource       : HikariPool-1 - Shutdown initiated...
2020-06-08 22:00:00.214  INFO [ ,,,] 32215 --- [       Thread-9] com.zaxxer.hikari.HikariDataSource       : HikariPool-1 - Shutdown completed.

What can be the actual cause of this issue?这个问题的真正原因可能是什么? Is this like a database cant be triggered SELECT query for 100K times regularly for 4-6 hours.这是否像数据库无法触发 SELECT 定期查询 100K 次,持续 4-6 小时。

I re-run the application with log-level in DEBUG mode and here is the error I got:我在调试模式下使用日志级别重新运行应用程序,这是我得到的错误:

com.ibm.db2.jcc.am.DisconnectNonTransientConnectionException: [jcc][t4][2030][11211][4.19.72] A communication error occurred during operations on the connection's underlying socket, socket input stream, 
or socket output stream.  Error location: Command timeout check.  Message: Command timed out. ERRORCODE=-4499, SQLSTATE=08001

It seems like your database connection has been lost.您的数据库连接似乎已丢失。 You need to restart your job instance.您需要重新启动作业实例。 If correctly configured, your job should restart from where it left off after the failure.如果配置正确,您的作业应该从失败后停止的地方重新开始。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 DB2 jdbc 连接错误连接被拒绝。 错误代码=-4499,SQLSTATE=08001 - DB2 jdbc connection error Connection refused. ERRORCODE=-4499, SQLSTATE=08001 DB2和MyBatis连接被拒绝:连接。 错误代码= -4499,SQLSTATE = 08001 - DB2 and MyBatis Connection refused: connect. ERRORCODE=-4499, SQLSTATE=08001 JDBCExceptionReporter - SQL错误:0,SQLState:08001 - JDBCExceptionReporter - SQL Error: 0, SQLState: 08001 DB2错误代码4499 SQLSTATE = 58009 - DB2 ERRORCODE 4499 SQLSTATE=58009 DB2错误SQLCODE = -103,SQLSTATE = 42604 - DB2 Error SQLCODE=-103, SQLSTATE=42604 Db2 .SqlIntegrityConstraintViolationException:SQLCODE = -803,SQLSTATE = 23505 - Db2 .SqlIntegrityConstraintViolationException: SQLCODE=-803, SQLSTATE=23505 无法使用 JDBC 驱动程序 SQLState 08001 连接到 MS SQL Server - Can not connect to MS SQL Server using JDBC driver SQLState 08001 SQLException: 无法创建到数据库服务器的连接。 SQLState: 08001 - SQLException: Could not create connection to database server. SQLState: 08001 对SQL查询(DB2)使用PreparedStatement SQLCODE = -206 SQLSTATE = 42703 - Using a PreparedStatement for a SQL query (DB2) SQLCODE=-206 SQLSTATE=42703 在什么情况下会导致LockAcquisitionException和SQLCODE = -911,SQLSTATE = 40001,SQLERRMC = 68 - In what condition will cause LockAcquisitionException and SQLCODE=-911, SQLSTATE=40001, SQLERRMC=68
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM