hello:
i am using a Perl-Tk program to access data in a mysql database. the start of
the program is as below:
------------------- start -------------------
#!/usr/bin/perl -w
use DBI ;
use DBD::mysql ;
use Tk ;
require Tk::TableMatrix ;
use Tk::widgets qw/Dialog/;
use subs qw/file_menuitems help_menuitems menubar_menuitems/ ;
require Tk::LabEntry ;
{
. . . . .
$db = DBI->connect( $dbconn , $user , $passwd ) ;
. . . . .
-------------------- end --------------------
i am using the script to allow the user to add, delete, or modify records. as
there business rules specifying that the data will reside in three different
tables, i do a $db->begin_work before i start the save or delete. (modify
does not require multiple table update!) if there is a an error along the
way, i do a $db->rollback; otherwise, i do a $db->commit ;
the problem i am having arises when i do a rollback. if i do a
$rc = $db->rollback ;
there is no rollback and $db->errstr is not set. further more, $rc = "". on
the other hand, if i do a
$rc = $db->rollback or warn $db->errstr ;
the rollback fails and i get the following message at the command line:
Use of uninitialized value in warn at ./mega.pl line 883.
Warning: something's wrong at ./mega.pl line 883.
and i print the $rc value:
Return Code: 1
a dialog box is shown when
------------- start --------------
if ( defined( $rc ) && $rc > 0 )
{
$error = "An error occurred during a rollback operation\n$db->errstr" ;
$mbox = $mw->Dialog( -title => 'Error' ,
-buttons => [ 'Cancel' ] ,
-default_button => 'Cancel' ,
-text => "$error" ) ;
$mbox->Show ;
}
-------------- end ---------------
with this message:
An error occurred during a rollback operation
DBI::db=HASH(0x851f8c4)->errstr
does mysql not support rollback (documentation indicates that it does!) or is
there something obvious that i am missing???
any assist is greatly appreciated.
--
regards,
allen wayne best, esq
"your friendly neighborhood rambler owner"
"my rambler will go from 0 to 105"
Current date: 44:41:19::313:2002
Birds and bees have as much to do with the facts of life as black
nightgowns do with keeping warm.
-- Hester Mundis, "Powermom"
---------------------------------------------------------------------
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