Thursday, 12 April 2012

Calypso v12 API changes - Disconnecting a client from the DataServer

In previous versions of Calypso the following code would have worked as expected:

DSConnection ds = ConnectionUtil.connect(username, password, appName, environmentName);
// Do some stuff ...
ds.disconnect();

In the v12 API (SP5) the disconnect() method has been deprecated and unfortunately the JavaDocs were not updated to specify that the DSConnection.logout() method must be used instead. This is also not mentioned in the developer guide, nor is the fact that the client application will not be able to complete cleanly (at least without a call to System.exit()) before the logout() method is called.

A more logical deprecation implementation would have been to call DSConnection.logout() from the disconnect() method.