bless { filename => $f, fmap => {} }, $cls;
}
-sub lms_commit { delete($_[0]->{dbh})->commit }
-
-sub lms_begin { ($_[0]->{dbh} //= dbh_new($_[0], 1))->begin_work };
+sub lms_write_prepare { ($_[0]->{dbh} //= dbh_new($_[0], 1)) };
sub create_tables {
my ($dbh) = @_;
}
sub set_src {
- my ($self, $oidhex, $folder, $id) = @_;
+ my ($self, $oidbin, $folder, $id) = @_;
my $fid = $self->{fmap}->{$folder} //= fid_for($self, $folder, 1);
my $sth;
if (ref($id)) { # scalar name
INSERT OR IGNORE INTO blob2num (oidbin, fid, uid) VALUES (?, ?, ?)
}
- $sth->execute(pack('H*', $oidhex), $fid, $id);
+ $sth->execute($oidbin, $fid, $id);
}
sub clear_src {
$oidbin ? unpack('H*', $oidbin) : undef;
}
-# FIXED? something with "lei <up|q>" is causing uncommitted transaction
-# TODO: remove soon
-sub DESTROY {
- my ($self) = @_;
- my $dbh = delete($self->{dbh}) or return;
- return if $dbh->{ReadOnly};
- undef $dbh;
- warn "BUG $$ $0 $self {dbh} OPEN ppid=".getppid.' '.Carp::longmess();
-}
-
1;