DSConnection ds = ConnectionUtil.connect(username, password, appName, environmentName);
// Do some stuff ...
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.