Open jeoffreylim opened 5 years ago
this is somehow proprietary to each database, e.g for postgres one need to execute a SQL statement that will do that
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 notifications@github.com 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 .
+1
as part of the API I don't understand how the Supplier<String> startTxSql
works
I think that the startTxSql
should instead be replaced by an enum like the sql-common
Reference:
https://vertx.io/docs/apidocs/io/vertx/ext/sql/SQLOptions.html#getTransactionIsolation-- https://vertx.io/docs/apidocs/io/vertx/ext/sql/TransactionIsolation.html