maria-discuss team mailing list archive
Mailing list archive
Re: Connector Net Question
On 17.05.2017 16:36, ksubramanian@xxxxxxxxxxxxxxx wrote:
My guess is that it is because it is how most people expect it to
behave. I certainly do, and I'm not alone.
The reason for disable the auto-commit is to mimic more or less
similar to oracle behaviour. Because our existing system was in
oracle. Just asking out of curiosity – why we enable auto-commit by
default in Maria DB. I felt that it wont give control on how we
maintain the transaction.
JDBC mandates autocommit=on after connection.
"When a connection is created, it is in auto-commit mode. This means
that each individual SQL statement is treated as a transaction and is
automatically committed right after it is executed. (To be more precise,
the default is for a SQL statement to be committed when it is completed,
not when it is executed. A statement is completed when all of its result
sets and update counts have been retrieved. In almost all cases,
however, a statement is completed, and therefore committed, right after
it is executed.)
The way to allow two or more statements to be grouped into a transaction
is to disable the auto-commit mode. This is demonstrated in the
following code, where con is an active connection:
Another example, SQLServer defaults to autocommit mode as well
Those who never used SQLServer,MySQL, or JDBC may have different
expectations of the default.
Can anyone provide some reasons for why we need to keep the
auto-commit enabled at server level.
Sent from Mail <https://go.microsoft.com/fwlink/?LinkId=550986> for
*From: *Vladislav Vaintroub <mailto:vvaintroub@xxxxxxxxx>
*Sent: *17 May 2017 18:08
<mailto:ksubramanian@xxxxxxxxxxxxxxx>; Maria Discuss
*Subject: *Re: [Maria-discuss] Connector Net Question
On 17.05.2017 11:26, ksubramanian@xxxxxxxxxxxxxxx
We have set auto-commit=false at server level.
But our .Net developers want to enable this auto-commit as true
(default behaviour) that I hesitant to do that. Is there any
connector (driver) properties that we can set at connection level
for auto-commit. I know in JDBC driver, we have the properties
that we can set at driver level when we establish connection to
DB. But for connector/Net I am trying to find, couldn’t locate
one. I noticed auto-enlist sett to true or false, not sure whether
this will mimic the auto-commit functionality in a given connection.
Can anyone using .Net and MariaDB combination help me to share
your thought on this.
Out of curiosity, what is the reason for you to use the non-default
behavior (global auto-commit=false)?
As far as I know, you cannot set arbitrary session variable
automatically with C/NET, and there is no property for autocommit.
Thus this would need to be done in code, just after connecting, e.g
Sent from Mail <https://go.microsoft.com/fwlink/?LinkId=550986>
for Windows 10
Post to :maria-discuss@xxxxxxxxxxxxxxxxxxx
More help :https://help.launchpad.net/ListHelp