Skip to content

Commit 50497ab

Browse files
Rename method, add missing header, javadoc
1 parent c47516a commit 50497ab

File tree

4 files changed

+17
-3
lines changed

4 files changed

+17
-3
lines changed

vertx-sql-client/src/main/java/io/vertx/sqlclient/SqlConnection.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,10 @@ public interface SqlConnection extends SqlClient {
9292
*/
9393
Future<Transaction> begin();
9494

95-
Transaction getTransaction();
95+
/**
96+
* @return the current transaction if it exists, otherwise null
97+
*/
98+
Transaction transaction();
9699

97100
/**
98101
* @return whether the connection uses SSL

vertx-sql-client/src/main/java/io/vertx/sqlclient/TransactionMode.java

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,14 @@
1+
/*
2+
* Copyright (c) 2011-2022 Contributors to the Eclipse Foundation
3+
*
4+
* This program and the accompanying materials are made available under the
5+
* terms of the Eclipse Public License 2.0 which is available at
6+
* http://www.eclipse.org/legal/epl-2.0, or the Apache License, Version 2.0
7+
* which is available at https://www.apache.org/licenses/LICENSE-2.0.
8+
*
9+
* SPDX-License-Identifier: EPL-2.0 OR Apache-2.0
10+
*/
11+
112
package io.vertx.sqlclient;
213

314
import java.util.function.Function;

vertx-sql-client/src/main/java/io/vertx/sqlclient/impl/PoolImpl.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ public Future<SqlConnection> getConnection() {
167167
.flatMap(conn -> function.apply(conn)
168168
.onFailure(err -> {
169169
if (!(err instanceof TransactionRollbackException)) {
170-
conn.getTransaction().rollback();
170+
conn.transaction().rollback();
171171
}
172172
}));
173173
}

vertx-sql-client/src/main/java/io/vertx/sqlclient/impl/SqlConnectionBase.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ public Future<Transaction> begin() {
166166
}
167167

168168
@Override
169-
public Transaction getTransaction() {
169+
public Transaction transaction() {
170170
return tx;
171171
}
172172

0 commit comments

Comments
 (0)