+ my($self, $timestamp) = @_;
+ my $dbh = dbh;
+ my $sth = $dbh->prepare("LOCK TABLES nas WRITE");
+ $sth->execute or die $sth->errstr; #die?
+ my $lock_self = qsearchs('nas', { 'nasnum' => $self->nasnum } )
+ or die "can't find own record for $self nasnum ". $self->nasnum;
+ if ( $timestamp > $lock_self->last ) {
+ my $new_self = new FS::nas ( { $lock_self->hash } );
+ $new_self->last($timestamp);
+ #is there a reason to? #$self->last($timestamp);
+ $new_self->replace($lock_self);
+ };
+ $sth = $dbh->prepare("UNLOCK TABLES");
+ $sth->execute or die $sth->errstr; #die?