I use Apache BasicDataSource for both the DBCP database and the connection pool:
org.apache.commons.dbcp.BasicDataSource
and controlling it through Spring:
org.springframework.jdbc.datasource.DataSourceTransactionManager
When using this combination with the Teradata JDBC driver, if my database goes down or a network failure occurs, I get the following error:
08S01 804: I / O error, closing the socket. Error writing packet stream
This correctly reflects the situation, but the problem is reconnecting. When the error is physically smoothed out or the DB returns and my program tries to request it, I still get the same error for some period of time that changes, for example. 20 minutes, hours, never. The problem goes away when I restart the JVM or change the connection string, for example. use an IP address instead of a host name.
Is there any parameter in the DataSource or Spring Transaction Manager that can fix this? or maybe TCP / IP settings?
source share