JDBC errors in Wildfly java.net.SocketTimeoutException: Socket read interrupted

book

Article ID: 205920

calendar_today

Updated On:

Products

CA Identity Manager CA Identity Governance CA Identity Portal CA Identity Suite

Issue/Introduction

JDBC related error appears in eurekify.log randomly

ERROR [org.springframework.transaction.interceptor.TransactionInterceptor] (Merge thread-3) Application exception overridden by rollback exception: org.springframework.dao.DataAccessResourceFailureException: PreparedStatementCallback; SQL [begin INSERT INTO ResourceFields (ResourceID, DatabaseID, FieldNumber, FieldValue) values (?,?,?,?); exception when dup_val_on_index then UPDATE ResourceFields set FieldValue =? WHERE ResourceID=? and DatabaseID=? and FieldNumber=?; end;]; IO Error: Socket read interrupted; nested exception is java.sql.SQLRecoverableException: IO Error: Socket read interrupted
 at org.springframework.jdbc.support.SQLErrorCodeSQLExceptionTranslator.doTranslate(SQLErrorCodeSQLExceptionTranslator.java:253) [spring-jdbc-3.0.6.RELEASE.jar:3.0.6.RELEASE]
 at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:72) [spring-jdbc-3.0.6.RELEASE.jar:3.0.6.RELEASE]
 at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:602) [spring-jdbc-3.0.6.RELEASE.jar:3.0.6.RELEASE]
 at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:614) [spring-jdbc-3.0.6.RELEASE.jar:3.0.6.RELEASE]
 at org.springframework.jdbc.core.JdbcTemplate.batchUpdate(JdbcTemplate.java:883) [spring-jdbc-3.0.6.RELEASE.jar:3.0.6.RELEASE]
 at org.springframework.jdbc.object.BatchSqlUpdate.flush(BatchSqlUpdate.java:184) [spring-jdbc-3.0.6.RELEASE.jar:3.0.6.RELEASE]
 at org.springframework.jdbc.object.BatchSqlUpdate.update(BatchSqlUpdate.java:169) [spring-jdbc-3.0.6.RELEASE.jar:3.0.6.RELEASE]
 at com.eurekify.dal.query.batch.BatchUpdateResourceCustomFieldsOracle.update(BatchUpdateResourceCustomFieldsOracle.java:50) [classes:]
 at com.eurekify.dal.SageJdbcDalImpl.batchUpdateResourceCustomFields(SageJdbcDalImpl.java:4630) [classes:]

..

Caused by: java.sql.SQLRecoverableException: IO Error: Socket read interrupted
 at oracle.jdbc.driver.T4CPreparedStatement.executeForRows(T4CPreparedStatement.java:932) [ojdbc8-12.2.0.1.jar:12.2.0.1.0]
 at oracle.jdbc.driver.OraclePreparedStatement.executeForRowsWithTimeout(OraclePreparedStatement.java:9804) [ojdbc8-12.2.0.1.jar:12.2.0.1.0]
 at oracle.jdbc.driver.OraclePreparedStatement.executeLargeBatch(OraclePreparedStatement.java:9954) [ojdbc8-12.2.0.1.jar:12.2.0.1.0]
 at oracle.jdbc.driver.T4CPreparedStatement.executeLargeBatch(T4CPreparedStatement.java:1364) [ojdbc8-12.2.0.1.jar:12.2.0.1.0]
 at oracle.jdbc.driver.OraclePreparedStatement.executeBatch(OraclePreparedStatement.java:9839) [ojdbc8-12.2.0.1.jar:12.2.0.1.0]
 at oracle.jdbc.driver.OracleStatementWrapper.executeBatch(OracleStatementWrapper.java:234) [ojdbc8-12.2.0.1.jar:12.2.0.1.0]
 at org.jboss.jca.adapters.jdbc.WrappedStatement.executeBatch(WrappedStatement.java:1077)
 at org.springframework.jdbc.core.JdbcTemplate$4.doInPreparedStatement(JdbcTemplate.java:898) [spring-jdbc-3.0.6.RELEASE.jar:3.0.6.RELEASE]
 at org.springframework.jdbc.core.JdbcTemplate$4.doInPreparedStatement(JdbcTemplate.java:1) [spring-jdbc-3.0.6.RELEASE.jar:3.0.6.RELEASE]
 at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:586) [spring-jdbc-3.0.6.RELEASE.jar:3.0.6.RELEASE]
 ... 54 more
Caused by: java.net.SocketTimeoutException: Socket read interrupted
 at oracle.net.nt.TimeoutSocketChannel.read(TimeoutSocketChannel.java:152) [ojdbc8-12.2.0.1.jar:12.2.0.1.0]
 at oracle.net.ns.NIOHeader.readHeaderBuffer(NIOHeader.java:82) [ojdbc8-12.2.0.1.jar:12.2.0.1.0]
 at oracle.net.ns.NIOPacket.readFromSocketChannel(NIOPacket.java:139) [ojdbc8-12.2.0.1.jar:12.2.0.1.0]
 at oracle.net.ns.NIOPacket.readFromSocketChannel(NIOPacket.java:101) [ojdbc8-12.2.0.1.jar:12.2.0.1.0]
 at oracle.net.ns.NIONSDataChannel.readDataFromSocketChannel(NIONSDataChannel.java:80) [ojdbc8-12.2.0.1.jar:12.2.0.1.0]
 at oracle.jdbc.driver.T4CMAREngineNIO.prepareForReading(T4CMAREngineNIO.java:98) [ojdbc8-12.2.0.1.jar:12.2.0.1.0]
 at oracle.jdbc.driver.T4CMAREngineNIO.unmarshalUB1(T4CMAREngineNIO.java:534) [ojdbc8-12.2.0.1.jar:12.2.0.1.0]
 at oracle.jdbc.driver.T4CTTIfun.receive(T4CTTIfun.java:485) [ojdbc8-12.2.0.1.jar:12.2.0.1.0]
 at oracle.jdbc.driver.T4CTTIfun.doRPC(T4CTTIfun.java:252) [ojdbc8-12.2.0.1.jar:12.2.0.1.0]
 at oracle.jdbc.driver.T4C8Oall.doOALL(T4C8Oall.java:612) [ojdbc8-12.2.0.1.jar:12.2.0.1.0]
 at oracle.jdbc.driver.T4CPreparedStatement.doOall8(T4CPreparedStatement.java:226) [ojdbc8-12.2.0.1.jar:12.2.0.1.0]
 at oracle.jdbc.driver.T4CPreparedStatement.doOall8(T4CPreparedStatement.java:59) [ojdbc8-12.2.0.1.jar:12.2.0.1.0]
 at oracle.jdbc.driver.T4CPreparedStatement.executeForRows(T4CPreparedStatement.java:910) [ojdbc8-12.2.0.1.jar:12.2.0.1.0]
 ... 63 more

Cause

This seems to be a possible behavior of Oracle 12.2.0.1 and above JDBC driver which uses Java NIO calls in blocking mode.

Environment

Release : 14.3

Component : GovernanceMinder(Role & Compliance Manager)

DB: Oracle 12c

Resolution

Add the Java parameter

-Doracle.jdbc.javaNetNio=false

to the jvm_args via standalone.conf.bat (in vApp, modify /opt/CA/VirtualAppliance/custom/IdentityGovernance/jvm-args.conf)