Package org.jdbi.v3.core
Class Handles
java.lang.Object
org.jdbi.v3.core.Handles
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionaddListener
(HandleListener handleListener) Add aHandleListener
which is called for specific events.Returns a copy of this configuration object.Returns the collection ofHandleListener
objects.boolean
Returns whether to enforce transaction termination discipline when aHandle
is closed.removeListener
(HandleListener handleListener) Remove aHandleListener
.void
setForceEndTransactions
(boolean forceEndTransactions) Sets whether to enforce transaction termination discipline when aHandle
is closed.Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.jdbi.v3.core.config.JdbiConfig
setRegistry
-
Constructor Details
-
Handles
public Handles()
-
-
Method Details
-
isForceEndTransactions
public boolean isForceEndTransactions()Returns whether to enforce transaction termination discipline when aHandle
is closed. This check is enabled by default. If enabled, and a handle is closed while a transaction is active (i.e. not committed or rolled back), an exception will be thrown.
This check does not apply to handles allocated with a connection that already has an open transaction.- Returns:
- whether to enforce transaction termination discipline when a
Handle
is closed.
-
setForceEndTransactions
public void setForceEndTransactions(boolean forceEndTransactions) Sets whether to enforce transaction termination discipline when aHandle
is closed.- Parameters:
forceEndTransactions
- whether to enforce transaction termination discipline.
-
addListener
Add aHandleListener
which is called for specific events. Adding a listener will add it to all Handles that are subsequently created (this call does not affect existing handles).- Parameters:
handleListener
- AHandleListener
object.- Returns:
- The Handles object itself.
-
removeListener
Remove aHandleListener
. Removing a listener will only affect Handles that are subsequently created, not existing handles.- Parameters:
handleListener
- AHandleListener
object.- Returns:
- The Handles object itself.
-
getListeners
Returns the collection ofHandleListener
objects. This set is immutable.- Returns:
- A set of
HandleListener
objects. The set is never null, can be empty and is immutable.
-
createCopy
Description copied from interface:JdbiConfig
Returns a copy of this configuration object. Changes to the copy should not modify the original, and vice-versa.- Specified by:
createCopy
in interfaceJdbiConfig<Handles>
- Returns:
- a copy of this configuration object.
-