# Companion

object Companion

## Properties

defaultDatabase
Link copied to clipboard
@get:Synchronized
@set:Synchronized
var defaultDatabase: Database?

The database to use by default in all transactions.

manager
Link copied to clipboard
val manager: TransactionManager

The current thread's TransactionManager instance.

## Functions

closeAndUnregister
Link copied to clipboard
@Synchronized
fun closeAndUnregister(database: Database)

Clears any association between the provided database and its TransactionManager, and ensures that the database instance will not be available for use in future transactions.

current
Link copied to clipboard
fun current(): Transaction

Returns the current Transaction.

currentOrNew
Link copied to clipboard
fun currentOrNew(isolation: Int): Transaction

Returns the current Transaction, or creates a new transaction with the provided isolation level.

currentOrNull
Link copied to clipboard
fun currentOrNull(): Transaction?

Returns the current Transaction, or `null` if none exists.

isInitialized
Link copied to clipboard
fun isInitialized(): Boolean

Whether any TransactionManager instance has been initialized by a database.

managerFor
Link copied to clipboard
fun managerFor(database: Database?): TransactionManager?

Returns the TransactionManager instance that is associated with the provided database, or `null` if a manager has not been registered for the database.

registerManager
Link copied to clipboard
@Synchronized
fun registerManager(database: Database, manager: TransactionManager)

Associates the provided database with a specific manager.

resetCurrent
Link copied to clipboard
fun resetCurrent(manager: TransactionManager?)

Sets the current thread's copy of the TransactionManager instance to the specified manager.