$h->begin_work

$h->begin_work

am 30.03.2004 19:02:26 von Mayuran

From a previous email:

$dbh->begin_work is currently not support by DBD::mysql
local ($dbh->{AutoCommit}) = 0; Will work with the draw back that it will
automatically commit when AutoCommit gets flipped back to 1.


Can someone verify this? Because I have been doing transactions
using $dbh->begin_work for the longest time and perl/DBD::mysql has
never complained. I dont want to set AutoCommit=>0 in my connection
string because not everything inside the script needs to be done in
a transaction.

Thanks.




--
MySQL Perl Mailing List
For list archives: http://lists.mysql.com/perl
To unsubscribe: http://lists.mysql.com/perl?unsub=gcdmp-msql-mysql-modules@m .gmane.org

Re: $h->begin_work

am 31.03.2004 01:12:11 von Rudy Lippan

On Tue, 30 Mar 2004, mayuran wrote:

> From a previous email:
>
> $dbh->begin_work is currently not support by DBD::mysql
> local ($dbh->{AutoCommit}) = 0; Will work with the draw back that it will
> automatically commit when AutoCommit gets flipped back to 1.
>
>
> Can someone verify this? Because I have been doing transactions
> using $dbh->begin_work for the longest time and perl/DBD::mysql has
> never complained. I dont want to set AutoCommit=>0 in my connection
> string because not everything inside the script needs to be done in
> a transaction.

From DBI docs:
Added $dbh->begin_work. This method causes AutoCommit to be turned
off just until the next commit() or rollback().
Driver authors: if the DBIcf_BegunWork flag is set when your commit or
rollback method is called then please turn AutoCommit on and clear the
DBIcf_BegunWork flag. If you don't then the DBI will but it'll be much
less efficient and won't handle error conditions very cleanly.
Retested on perl 5.4.4, but the DBI won't support 5.4.x much longer.


The code to turn off autocommit is not in place in 2.9003, but it looks
like DBI will do for the driver, in this case. So it looks like it will
work, but not be as clean as it should be. I guess that means that it is
supported as implemented by the DBI. Go figure.


Rudy


--
MySQL Perl Mailing List
For list archives: http://lists.mysql.com/perl
To unsubscribe: http://lists.mysql.com/perl?unsub=gcdmp-msql-mysql-modules@m .gmane.org

Re: $h->begin_work

am 31.03.2004 01:12:11 von Rudy Lippan

On Tue, 30 Mar 2004, mayuran wrote:

> From a previous email:
>
> $dbh->begin_work is currently not support by DBD::mysql
> local ($dbh->{AutoCommit}) = 0; Will work with the draw back that it will
> automatically commit when AutoCommit gets flipped back to 1.
>
>
> Can someone verify this? Because I have been doing transactions
> using $dbh->begin_work for the longest time and perl/DBD::mysql has
> never complained. I dont want to set AutoCommit=>0 in my connection
> string because not everything inside the script needs to be done in
> a transaction.

From DBI docs:
Added $dbh->begin_work. This method causes AutoCommit to be turned
off just until the next commit() or rollback().
Driver authors: if the DBIcf_BegunWork flag is set when your commit or
rollback method is called then please turn AutoCommit on and clear the
DBIcf_BegunWork flag. If you don't then the DBI will but it'll be much
less efficient and won't handle error conditions very cleanly.
Retested on perl 5.4.4, but the DBI won't support 5.4.x much longer.


The code to turn off autocommit is not in place in 2.9003, but it looks
like DBI will do for the driver, in this case. So it looks like it will
work, but not be as clean as it should be. I guess that means that it is
supported as implemented by the DBI. Go figure.


Rudy


--
MySQL Perl Mailing List
For list archives: http://lists.mysql.com/perl
To unsubscribe: http://lists.mysql.com/perl?unsub=gcdmp-msql-mysql-modules@m .gmane.org