-
Notifications
You must be signed in to change notification settings - Fork 201
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1231 from technical-debt-collector/master
Create propagatable connection, add Transaction accessor
- Loading branch information
Showing
7 changed files
with
148 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
36 changes: 36 additions & 0 deletions
36
vertx-sql-client/src/main/java/io/vertx/sqlclient/TransactionPropagation.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
/* | ||
* Copyright (c) 2011-2022 Contributors to the Eclipse Foundation | ||
* | ||
* This program and the accompanying materials are made available under the | ||
* terms of the Eclipse Public License 2.0 which is available at | ||
* http://www.eclipse.org/legal/epl-2.0, or the Apache License, Version 2.0 | ||
* which is available at https://www.apache.org/licenses/LICENSE-2.0. | ||
* | ||
* SPDX-License-Identifier: EPL-2.0 OR Apache-2.0 | ||
*/ | ||
|
||
package io.vertx.sqlclient; | ||
|
||
import java.util.function.Function; | ||
|
||
/** | ||
* Defines how the acquired connection will be managed during the execution of the function provided in | ||
* {@link Pool#withTransaction(TransactionPropagation, Function)}. | ||
*/ | ||
public enum TransactionPropagation { | ||
|
||
/** | ||
* The acquired connection is not stored anywhere, making it local to the provided function execution and to | ||
* wherever it is passed. | ||
*/ | ||
NONE, | ||
|
||
/** | ||
* Keeps the acquired connection stored in the local context for as long as the given function executes. | ||
* Any subsequent calls to {@link Pool#withTransaction} with this mode during the function execution | ||
* will retrieve this connection from the context instead of creating another. | ||
* The connection is removed from the local context when the function block has completed. | ||
*/ | ||
CONTEXT | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters