Class OneThread
java.lang.Object
uk.ac.manchester.spinnaker.storage.threading.OneThread
A wrapper for an SQL connection that enforces that it is only used from its
creating thread.
- Author:
- Donal Fellows
-
Method Summary
Modifier and TypeMethodDescriptionstatic Connection
threadBound
(Connection conn) Create the wrapper.static Connection
Create the wrapper.
-
Method Details
-
threadBound
Create the wrapper.- Parameters:
conn
- The connection that is being protected.- Returns:
- The wrapped connection.
-
uncloseableThreadBound
Create the wrapper. This wrapper cannot be closed (theConnection.close()
method fails silently); it is up to the caller to save the wrapped connection and close it at the right time.- Parameters:
conn
- The connection that is being protected.- Returns:
- The wrapped connection.
-