IBM BPM, V8.0.1, All platforms > Authoring services in Integration Designer > Services and service-related functions > Access external services with adapters > Configure and using adapters > IBM WebSphere Adapters > Adapter Toolkit > Implementing code from the IBM WebSphere Adapter Toolkit > Outbound support

Manage stale connections

Connection-related problems can be resolved in your adapter using the two properties, connectionRetryLimit and connectionRetryInterval defined in the Managed connection factory of your adapter.

These two properties are used to provide the following features during outbound communication of the adapter and are optional by default.

These features take care of connections which are timed out or became stale after EIS restarts. Even though this option solves most of connection-related problems, the adapter is not guaranteed to work 100 percent error free for connection problems.


Examples of connectionRetryLimit and connectionRetryInterval


Method for retry connection to EIS ( < AdapterPrefixName>ManagedConnection.java)

private void getEISConnection(PasswordCredential pc, boolean reauthenticate) {
// TODO 
	 int retryLimit = test_mcf.getConnectionRetryLimit();
         if(retryLimit< 0){
         	retryLimit =0;
         }          int retryInterval = test_mcf.getConnectionRetryInterval();
         
         //TODO 
          for(int i =0; i<=retryLimit;i++){
             	if(i>0){
     

If the property connectionRetryLimit is > 0, during each such request, the adapter validates if the EIS connection is active or alive. If the connection is valid, the operation is completed as usual. If the connection is invalid, the adapter invalidates the current managed connection, so that a new managed connection is created (new physical connection). If the connection is created successfully, the outbound operation is completed. Otherwise, an error ResourceException is thrown


Method for validating the connection to EIS ( < AdapterPrefixName>ManagedConnectionFactory.java)

public boolean validateManagedConnection(WBIManagedConnection mngConn){
		//TODO
		return true;
		}

Outbound support