Java Clients
Returning Connections to the Java Connection FactoryWhen you are finished using a connection that you have obtained from the Java Connection Factory, you must return the connection to the factory so that it can be either reused or canceled. Returning a Connection to the Java Connection FactoryTo return a connection to the Java Connection Factory, call the The objects that implement the If you do not explicitly close a connection, it will close itself when it is no longer referenced and is garbage collected. However, you generally cannot determine when or if garbage collection will occur. Therefore, it is recommended that you explicitly close your connection if at all possible rather than depending on garbage collection. Shutting Down the Java Connection FactoryWhen you are finished with the instance of the Java Connection Factory itself and you no longer need to request connections from it, you must shut it down so that any remaining connections can be canceled and other resources can be released. To shut down the Java Connection Factory, call one of the following methods:
It is often possible to cancel all connections and release all resources in an instance of the Java Connection Factory by calling Note: If you are using the PlatformConnectionFactory and the Session Service, you can shut down servers automatically by destroying a session. When you destroy a session, any repository connections associated with the session are destroyed. Additionally, all connection factories that were configured with the repository connections are shut down as with the |