Re: AUTOCOMMIT. displaying and setting

2006-11-21 Thread Visolve DB Team
Hi
Yes, you can set the variabe per-connection.
mysql > set SESSION autocommit=0;

Check with two connections.  For Transaction safe engines(such as InnoDB, BDB, 
or NDB Cluster),to disable autocommit mode for a single series of statements, 
use the START TRANSACTION or BEGIN  statement.  With START TRANSACTION, 
autocommit remains disabled until you end the transaction with COMMIT or 
ROLLBACK. The autocommit mode then reverts to its previous state once 
transaction done. 

Thanks 
ViSolve DB Team.

- Original Message - 
From: "Amit Dor-Shifer" <[EMAIL PROTECTED]>
To: "Visolve DB Team" <[EMAIL PROTECTED]>
Cc: 
Sent: Wednesday, November 22, 2006 10:59 AM
Subject: Re: AUTOCOMMIT. displaying and setting


> Thanks!
> I played a bit init_connect. I'm not sure though how can I verify the
> autocommit value. You say 'by select'. Something like this?
> 
> select @@AUTOCOMMIT;
> 
> Because that still gives me a value of '1'.
> 
> More important to me: Can this variable be set per-connection? If so,
> how? Specifically, how do I set it for a none-console connection (e.g.
> my previously mentioned jdbc connection)?
> 
> BTW:
> # mysql --version
> mysql  Ver 14.7 Distrib 4.1.21, for pc-linux-gnu (i686) using readline 5.1
> 
> Amit
> 
> Visolve DB Team wrote:
>> There is no global system variable to set Autocommit; but we can
>> achieve the
>> same with 'init_connect=SET AUTOCOMMIT=0'.
>> This variable can be set from the mysql or in the commandline or in the
>> option file.
>> Like,
>> mysql > SET GLOBAL init_connect='SET AUTOCOMMIT=0';
>> or
>> mysql>SET @@GLOBAL.init_connect='SET AUTOCOMMIT=0';
>>
>> or in the option file
>> [mysqld]
>> init_connect='set AUTOCOMMIT=0'
>> or
>> shell> mysqld --init_connect='set AUTOCOMMIT=0'
>> By default AUTOCOMMIT is enabled. ie set to 1. If set to 0, then
>> disabled.
>> check with 2 connections; try inserting or updating in one connection;
>> check
>> in the other with select.
>>
>> This variable was added in MySQL 4.1.2.
>>
>>
>> - Original Message - From: "Amit Dor-Shifer" <[EMAIL PROTECTED]>
>> To: 
>> Sent: Tuesday, November 21, 2006 4:41 PM
>> Subject: AUTOCOMMIT. displaying and setting
>>
>>
>>> Hi.
>>>
>>> I'm puzzled rgd. a/m. Is AUTOCOMMIT a variable? If so, is it a session
>>> variable?  Should it show up when issuing a "SHOW VARIABLES" command?
>>>
>>> How do I set this variable when initalizing a jdbc connection? Can I
>>> pass it on the connection URL? Can someone present a code line for this?
>>>
>>> How do I set this variable for an interactive console session? Can i do
>>> this from the command line?  When I attempt this I get:
>>> # mysql -p --autocommit=0;
>>> mysql: unknown variable 'autocommit=0'
>>>
>>>
>>> Thanks,
>>> Amit
>>>
>>> -- 
>>> MySQL General Mailing List
>>> For list archives: http://lists.mysql.com/mysql
>>> To unsubscribe:
>>> http://lists.mysql.com/[EMAIL PROTECTED]
>>>
>>
> 
> -- 
> MySQL General Mailing List
> For list archives: http://lists.mysql.com/mysql
> To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
>

Re: AUTOCOMMIT. displaying and setting

2006-11-21 Thread Amit Dor-Shifer
Thanks!
I played a bit init_connect. I'm not sure though how can I verify the
autocommit value. You say 'by select'. Something like this?

select @@AUTOCOMMIT;

Because that still gives me a value of '1'.

More important to me: Can this variable be set per-connection? If so,
how? Specifically, how do I set it for a none-console connection (e.g.
my previously mentioned jdbc connection)?

BTW:
# mysql --version
mysql  Ver 14.7 Distrib 4.1.21, for pc-linux-gnu (i686) using readline 5.1

Amit

Visolve DB Team wrote:
> There is no global system variable to set Autocommit; but we can
> achieve the
> same with 'init_connect=SET AUTOCOMMIT=0'.
> This variable can be set from the mysql or in the commandline or in the
> option file.
> Like,
> mysql > SET GLOBAL init_connect='SET AUTOCOMMIT=0';
> or
> mysql>SET @@GLOBAL.init_connect='SET AUTOCOMMIT=0';
>
> or in the option file
> [mysqld]
> init_connect='set AUTOCOMMIT=0'
> or
> shell> mysqld --init_connect='set AUTOCOMMIT=0'
> By default AUTOCOMMIT is enabled. ie set to 1. If set to 0, then
> disabled.
> check with 2 connections; try inserting or updating in one connection;
> check
> in the other with select.
>
> This variable was added in MySQL 4.1.2.
>
>
> ----- Original Message - From: "Amit Dor-Shifer" <[EMAIL PROTECTED]>
> To: 
> Sent: Tuesday, November 21, 2006 4:41 PM
> Subject: AUTOCOMMIT. displaying and setting
>
>
>> Hi.
>>
>> I'm puzzled rgd. a/m. Is AUTOCOMMIT a variable? If so, is it a session
>> variable?  Should it show up when issuing a "SHOW VARIABLES" command?
>>
>> How do I set this variable when initalizing a jdbc connection? Can I
>> pass it on the connection URL? Can someone present a code line for this?
>>
>> How do I set this variable for an interactive console session? Can i do
>> this from the command line?  When I attempt this I get:
>> # mysql -p --autocommit=0;
>> mysql: unknown variable 'autocommit=0'
>>
>>
>> Thanks,
>> Amit
>>
>> -- 
>> MySQL General Mailing List
>> For list archives: http://lists.mysql.com/mysql
>> To unsubscribe:
>> http://lists.mysql.com/[EMAIL PROTECTED]
>>
>

-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Re: AUTOCOMMIT. displaying and setting

2006-11-21 Thread Visolve DB Team

There is no global system variable to set Autocommit; but we can achieve the
same with 'init_connect=SET AUTOCOMMIT=0'.
This variable can be set from the mysql or in the commandline or in the
option file.
Like,
mysql > SET GLOBAL init_connect='SET AUTOCOMMIT=0';
or
mysql>SET @@GLOBAL.init_connect='SET AUTOCOMMIT=0';

or in the option file
[mysqld]
init_connect='set AUTOCOMMIT=0'
or
shell> mysqld --init_connect='set AUTOCOMMIT=0'
By default AUTOCOMMIT is enabled. ie set to 1. If set to 0, then disabled.
check with 2 connections; try inserting or updating in one connection; check
in the other with select.

This variable was added in MySQL 4.1.2.


- Original Message - 
From: "Amit Dor-Shifer" <[EMAIL PROTECTED]>

To: 
Sent: Tuesday, November 21, 2006 4:41 PM
Subject: AUTOCOMMIT. displaying and setting



Hi.

I'm puzzled rgd. a/m. Is AUTOCOMMIT a variable? If so, is it a session
variable?  Should it show up when issuing a "SHOW VARIABLES" command?

How do I set this variable when initalizing a jdbc connection? Can I
pass it on the connection URL? Can someone present a code line for this?

How do I set this variable for an interactive console session? Can i do
this from the command line?  When I attempt this I get:
# mysql -p --autocommit=0;
mysql: unknown variable 'autocommit=0'


Thanks,
Amit

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: 
http://lists.mysql.com/[EMAIL PROTECTED]





--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]