Re: global autocommit setting

2002-12-17 Thread Jani Tolonen
Hi!

Heikki Tuuri writes:
> Jari,
> 
> I am Cc:ing this to [EMAIL PROTECTED], so that other readers can follow
> the discussion.
> 
> There is still no my.cnf option to set AUTOCOMMIT=0 globally though users
> have requested it a lot.
> 
> I think that 4.1 will support a SQL script which is automatically executed
> for all new connections. That is naturally the most versatile method of
> session initialization.
> 
> Then you could write the SQL command SET AUTOCOMMIT=0 to that script. I am
> Cc:ing this to the MySQL AB developer who is responsible for global
> variables. He can inform us of the status of 4.1.

Some news:

- AUTOCOMMIT will become a global option in 4.0 and 4.1 within one
  month. Right now it is only available in session mode.
  
- The automatically executed SQL script option will appear in 4.1
  within two months.

- mysql client will soon (~ within two weeks) accept
  --init-command=... option, which can be used in this case too.
  Example: mysql --init-command="SET AUTOCOMMIT=0".
  This will be available in 4.1

However, you can probably already do this in your client;

just tell your client to read options additionally from a special
group, for example [my_group]. A Perl client could do it like this
for example:

$dbh= DBI->connect("DBI:mysql:test" .
   ";mysql_read_default_file=/path/to/my/defaut/options/file" .
   ";mysql_read_default_group=my_group")

In file '/path/to/my/defaut/options/file', within the group [my_group],
add this:

--
[my_group]
init-command=SET AUTOCOMMIT=0
--

This will execute the above command every time your client connects,
or reconnects to server.

Search documentation about 'mysql_options()' C API function for more
details.

> If the 4.1 SQL script method will be delayed, then I have to consider adding
> a new option
> 
> autocommit=0

Regards,

- Jani

For technical support contracts, visit https://order.mysql.com/
   __  ___ ___   __
  /  |/  /_ __/ __/ __ \/ /Mr. Jani Tolonen <[EMAIL PROTECTED]>
 / /|_/ / // /\ \/ /_/ / /__   MySQL AB, Full-Time Developer
/_/  /_/\_, /___/\___\_\___/   Helsinki, Finland
   <___/   www.mysql.com

-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




Re: global autocommit setting

2002-12-16 Thread Heikki Tuuri
Jari,

I am Cc:ing this to [EMAIL PROTECTED], so that other readers can follow
the discussion.

There is still no my.cnf option to set AUTOCOMMIT=0 globally though users
have requested it a lot.

I think that 4.1 will support a SQL script which is automatically executed
for all new connections. That is naturally the most versatile method of
session initialization.

Then you could write the SQL command SET AUTOCOMMIT=0 to that script. I am
Cc:ing this to the MySQL AB developer who is responsible for global
variables. He can inform us of the status of 4.1.

If the 4.1 SQL script method will be delayed, then I have to consider adding
a new option

autocommit=0

to my.cnf.

Best regards,

Heikki Tuuri
Innobase Oy
---
InnoDB - transactions, row level locking, and foreign key support for MySQL
See http://www.innodb.com, download MySQL-Max from http://www.mysql.com

 Original Message -
From: "Jari Nurminen" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, December 16, 2002 9:08 AM
Subject: global autocommit setting


I've read some discussion about a global autocommit setting i.e. set a
database default behaviour to autocommit=false, so that the application
doesn't have to use SET AUTOCOMMIT=0 method for every session. This is
actually what you would expect when using transactional databases like
InnoDB.

It seems that this feature is/will be included in MySQL, and now my question
is, is it already there?

For example Heikki from Innodb wrote in July 2002
(http://lists.mysql.com/cgi-ez/ezmlm-cgi?1:mss:115791) that it would be in
v4.0 around September but I failed to see an announcement if it is already
there ...

Cheers and thanks in advance,

- Jari Nurminen



-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php