public class Connection
extends java.lang.Object
ConnectionFactory. A connection can only run one transaction at a time, and nested
transactions are supported.| Modifier and Type | Method and Description |
|---|---|
void |
awaitClose()
Blocks until the connection has been closed.
|
void |
close()
Close the connection.
|
boolean |
isConnected()
Test to see if we're connected to the GoshawkDB node
|
<Result> io.goshawkdb.client.TransactionResult<Result> |
runTransaction(TransactionFun<Result> fun)
Run a transaction.
|
public boolean isConnected()
public void awaitClose()
throws java.lang.InterruptedException
java.lang.InterruptedException - if an interruption occurs.public void close()
throws java.lang.InterruptedException
java.lang.InterruptedException - if an interruption occurs whilst we're waiting for the
connection to close.public <Result> io.goshawkdb.client.TransactionResult<Result> runTransaction(TransactionFun<Result> fun) throws java.lang.Throwable
Result - The result of the transaction fuction.fun - The transaction function to run. This will be automatically restarted as many
times as necessary until the transaction either commits or chooses to abort.java.lang.Throwable - The transaction may through exceptions.