Entering content frame

Function documentation Reconnecting to the DB in Case of DB Crash Locate the document in its SAP Library structure

Use

If the database you are working with crashes, you cannot use the open connections to the DB anymore. The SAP J2EE Engine provides different solutions for reconnecting to the database when you use Open, Native, or Vendor SQL.

 

Features

If you use either Open SQL or Native SQL, the methods for working with connections should throw java.sql.SQLException. Each exception has an ID that is parsed within the OpenSQL/Native SQL framework. Some of the IDs signify that the database has crashed. In case of such exceptions, the DataSource you work with receives a javax.sql.ConnectionEventListener.connectionErrorOccurred() event. It closes the connections one by one and at reconnect to the DB provides new connections to the applications that work with it. The mechanism is the same if you use a JDBC 2.0 compliant driver.

With Vendor SQL, the system does not reconnect you automatically to the database and you have to reinitialize the DataSource manually. If you use a JDBC 2.0 compliant driver, automatic reconnect is possible in case that the JDBC driver returns javax.sql.ConnectionEventListener.connectionErrorOccurred() event. However, the JDBC drivers do not generally support this option.

 

Leaving content frame