Deploying and Managing Apama Applications > Using the Apama Database Connector > The ADBCHelper Application Programming Interface > Reconnection settings
Reconnection settings
Apama applications can automatically reconnect if a disconnection error is encountered. The reconnection capability is optional and the default is to not reconnect when a disconnection error occurs. The following reconnection actions are defined in the com.apama.database.DBUtil event.
*action setReconnectPolicy(string reconnectPolicy) — This action sets the policy for dealing with adapter connection errors. The reconnectPolicy parameter must be one of the constants specified in the DBReconnectPolicy event. The policy constants are as follows:
*RECONNECT — Try to reconnect and leave the management of pending requests to the client, which will handle the pending requests in the error handler.
*RECONNECT_AND_RETRY_LAST_REQUEST — Try to reconnect and leave the pending requests unchanged, retry the last request on a successful database reconnection.
*RECONNECT_AND_CLEAR_REQUEST_QUEUE — Try to reconnect and remove all the pending requests.
*DO_NOT_RECONNECT — Do not try to reconnect.
The default reconnect policy is DO_NOT_RECONNECT.
*action setReconnectTimeout(float timeOut) — This action sets the timeout for the reconnection after a connection error. A value specified by the setReconnectTimeout action overrides the default timeout value, which is equal to twice as long as specified by the open action's timeOut parameter.
Copyright © 2013 Software AG, Darmstadt, Germany and/or Software AG USA Inc., Reston, VA, USA, and/or Terracotta Inc., San Francisco, CA, USA, and/or Software AG (Canada) Inc., Cambridge, Ontario, Canada, and/or, Software AG (UK) Ltd., Derby, United Kingdom, and/or Software A.G. (Israel) Ltd., Or-Yehuda, Israel and/or their licensors.