vertx-sql-client icon indicating copy to clipboard operation
vertx-sql-client copied to clipboard

Support for configuring transaction characteristics

Open jeoffreylim opened this issue 6 years ago • 6 comments

Reference:

https://vertx.io/docs/apidocs/io/vertx/ext/sql/SQLOptions.html#getTransactionIsolation-- https://vertx.io/docs/apidocs/io/vertx/ext/sql/TransactionIsolation.html

jeoffreylim avatar Oct 12 '19 14:10 jeoffreylim

this is somehow proprietary to each database, e.g for postgres one need to execute a SQL statement that will do that

vietj avatar May 14 '20 11:05 vietj

Yes it differs between different database vendors. Postgres supports starting a transaction with configuring transaction isolation levels and characteristics https://www.postgresql.org/docs/current/sql-start-transaction.html. MySQL supports starting a transaction with configuring only transaction characteristics(but additionally WITH CONSISTENT SNAPSHOT) https://dev.mysql.com/doc/refman/8.0/en/commit.html MS SQL Server does not support such kind of configuration syntax to start a transaction. https://docs.microsoft.com/en-us/sql/t-sql/language-elements/begin-transaction-transact-sql?view=sql-server-ver15

I'm thinking we might provide an API which seems like this

SqlConnection#begin(Supplier<String> startTxSql, Handler<AsyncResult<
Transaction>> handler);

so that users could be able to decide how the transactions are started.

On Thu, May 14, 2020 at 7:41 PM Julien Viet [email protected] wrote:

this is somehow proprietary to each database, e.g for postgres one need to execute a SQL statement that will do that

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/eclipse-vertx/vertx-sql-client/issues/432#issuecomment-628577616, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABJV4JPDJWVC5CPTZ4XR7MDRRPKG3ANCNFSM4JADEB4Q .

BillyYccc avatar May 14 '20 14:05 BillyYccc

+1

vietj avatar May 15 '20 07:05 vietj

as part of the API I don't understand how the Supplier<String> startTxSql works

vietj avatar May 17 '20 07:05 vietj

I think that the startTxSql should instead be replaced by an enum like the sql-common

vietj avatar May 17 '20 07:05 vietj