/[webpac2]/trunk/lib/WebPAC/Output/DBI.pm
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /trunk/lib/WebPAC/Output/DBI.pm

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1343 by dpavlin, Sat May 30 20:30:26 2009 UTC revision 1344 by dpavlin, Sat Oct 16 17:40:56 2010 UTC
# Line 14  __PACKAGE__->mk_accessors(qw( Line 14  __PACKAGE__->mk_accessors(qw(
14          schema          schema
15    
16          table          table
17    
18            no_transaction
19  ));  ));
20    
21  use Data::Dump qw/dump/;  use Data::Dump qw/dump/;
# Line 42  sub init { Line 44  sub init {
44    
45          $self->{_dbh} = DBI->connect( $self->dsn, $self->user, $self->passwd, { RaiseError => 1 } );          $self->{_dbh} = DBI->connect( $self->dsn, $self->user, $self->passwd, { RaiseError => 1 } );
46    
47          $self->{_dbh}->begin_work;          $self->{_dbh}->begin_work unless $self->no_transaction;
48    
49          if ( -e $self->schema ) {          if ( -e $self->schema ) {
50                  foreach my $sql ( split(/;/, scalar read_file( $self->schema )) ) {                  foreach my $sql ( split(/;/, scalar read_file( $self->schema )) ) {
# Line 128  sub finish { Line 130  sub finish {
130    
131          $log->info('finish');          $log->info('finish');
132    
133          $self->{_dbh}->commit;          unless ( $self->no_transaction ) {
134                            $self->{_dbh}->commit;
135          $log->info('commit done');                  $log->info('commit done');
136            }
137    
138          return 1;          return 1;
139  }  }

Legend:
Removed from v.1343  
changed lines
  Added in v.1344

  ViewVC Help
Powered by ViewVC 1.1.26