Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ public interface SqlConnection extends SqlClient {
* Begin a transaction and returns a {@link Transaction} for controlling and tracking
* this transaction.
* <p/>
* When the connection is explicitely closed, any inflight transaction is rollbacked.
* When the connection is explicitely closed, any inflight transaction is rolled back.
*/
void begin(Handler<AsyncResult<Transaction>> handler);

Expand All @@ -77,6 +77,13 @@ public interface SqlConnection extends SqlClient {
*/
Future<Transaction> begin();

/**
* If @{link {@link #begin()} or {#link {@link #begin(Handler)} has been called, returns
* the associated transaction. Returns null otherwise.
* @return the current associated transaction, or null.
*/
Transaction currentTransaction();

/**
* @return whether the connection uses SSL
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,11 @@ public void handleClosed() {
}
}

@Override
public Transaction currentTransaction() {
return tx;
}

@Override
public <R> void schedule(CommandBase<R> cmd, Promise<R> promise) {
if (tx != null) {
Expand Down