/[wait]/trunk/lib/WAIT/Table.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/WAIT/Table.pm

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

revision 111 by dpavlin, Tue Jul 13 19:06:46 2004 UTC revision 113 by dpavlin, Tue Jul 13 20:28:45 2004 UTC
# Line 31  use WAIT::Table::Handle (); Line 31  use WAIT::Table::Handle ();
31  require WAIT::Parse::Base;  require WAIT::Parse::Base;
32    
33  use strict;  use strict;
34  use Carp;  use Carp qw(cluck croak);
35  # use autouse Carp => qw( croak($) );  # use autouse Carp => qw( croak($) );
36  use BerkeleyDB;  use BerkeleyDB;
37  use Fcntl;  use Fcntl;
# Line 410  sub open { Line 410  sub open {
410    my $flags;    my $flags;
411    if ($self->{mode} & O_RDWR) {    if ($self->{mode} & O_RDWR) {
412      $flags = DB_CREATE; # | DB_INIT_MPOOL | DB_PRIVATE | DB_INIT_CDB;      $flags = DB_CREATE; # | DB_INIT_MPOOL | DB_PRIVATE | DB_INIT_CDB;
413      warn "Flags on table $path set to 'writing'";      #warn "DEBUG: Flags on table $path set to 'writing'";
414    } else {    } else {
415      $flags = DB_RDONLY;      $flags = DB_RDONLY;
416      # warn "Flags on table $path set to 'readonly'";      #warn "DEBUG: Flags on table $path set to 'readonly'";
417    }    }
418    unless (defined $self->{dbh}) {    unless (defined $self->{dbh}) {
419      my $subname = $self->tablename . "/records";      my $subname = $self->tablename . "/records";
# Line 567  sub delete_by_key { Line 567  sub delete_by_key {
567    my $key   = shift;    my $key   = shift;
568    
569    unless ($key) {    unless ($key) {
570      Carp::cluck "Warning: delete_by_key called without key. Looks like a bug in WAIT?";      cluck "Warning: delete_by_key called without key. Looks like a bug in WAIT?";
571      return;      return;
572    }    }
573    
# Line 640  sub set { Line 640  sub set {
640  sub close {  sub close {
641    my $self = shift;    my $self = shift;
642    
643    require Carp; Carp::cluck("------->Closing A Table<-------");    #cluck("DEBUG: Closing A Table");
644    
645    if (exists $self->{'access'}) {    if (exists $self->{'access'}) {
646      eval {$self->{'access'}->close}; # dont bother if not opened      eval {$self->{'access'}->close}; # dont bother if not opened
# Line 672  sub close { Line 672  sub close {
672    untie %{$self->{db}};    untie %{$self->{db}};
673    for my $att (qw(env db path maindbfile)) {    for my $att (qw(env db path maindbfile)) {
674      delete $self->{$att};      delete $self->{$att};
675      warn "----->Deleted att $att<-----";      #cluck "DEBUG: Deleted att $att";
676    }    }
677    
678    1;    1;
# Line 752  sub search_ref { Line 752  sub search_ref {
752      $cont = $query->{cont};      $cont = $query->{cont};
753      $raw  = $query->{raw};      $raw  = $query->{raw};
754    } else {    } else {
755      require Carp;      cluck("Using three argument search interface is deprecated, use hashref interface instead");
     Carp::cluck("Using three argument search interface is deprecated, use hashref interface instead");  
756      $attr = shift;      $attr = shift;
757      $cont = shift;      $cont = shift;
758      $raw  = shift;      $raw  = shift;

Legend:
Removed from v.111  
changed lines
  Added in v.113

  ViewVC Help
Powered by ViewVC 1.1.26