# all class local variables stored in DBI derived class needs to have
# a prefix 'private_'. See DBI documentation.
- $self->{private_bz_tables_locked} = 0;
+ $self->{private_bz_tables_locked} = "";
bless ($self, $class);
sub bz_lock_tables {
my ($self, @tables) = @_;
+ my $list = join(', ', @tables);
# Check first if there was no lock before
if ($self->{private_bz_tables_locked}) {
- ThrowCodeError("already_locked");
+ ThrowCodeError("already_locked", { current => $self->{private_bz_tables_locked},
+ new => $list });
} else {
- $self->do('LOCK TABLE ' . join(', ', @tables));
+ $self->do('LOCK TABLE ' . $list);
- $self->{private_bz_tables_locked} = 1;
+ $self->{private_bz_tables_locked} = $list;
}
}
} else {
$self->do("UNLOCK TABLES");
- $self->{private_bz_tables_locked} = 0;
+ $self->{private_bz_tables_locked} = "";
}
}
# all class local variables stored in DBI derived class needs to have
# a prefix 'private_'. See DBI documentation.
- $self->{private_bz_tables_locked} = 0;
+ $self->{private_bz_tables_locked} = "";
bless ($self, $class);
sub bz_lock_tables {
my ($self, @tables) = @_;
+ my $list = join(', ', @tables);
# Check first if there was no lock before
if ($self->{private_bz_tables_locked}) {
- ThrowCodeError("already_locked");
+ ThrowCodeError("already_locked", { current => $self->{private_bz_tables_locked},
+ new => $list });
} else {
my %read_tables;
my %write_tables;
' IN ROW SHARE MODE') if keys %read_tables;
Bugzilla->dbh->do('LOCK TABLE ' . join(', ', keys %write_tables) .
' IN ROW EXCLUSIVE MODE') if keys %write_tables;
- $self->{private_bz_tables_locked} = 1;
+ $self->{private_bz_tables_locked} = $list;
}
}
return if $abort;
ThrowCodeError("no_matching_lock");
} else {
- $self->{private_bz_tables_locked} = 0;
+ $self->{private_bz_tables_locked} = "";
# End transaction, tables will be unlocked automatically
if ($abort) {
$self->bz_rollback_transaction();
Attempted to end transaction without starting one first.
[% ELSIF error == "already_locked" %]
- Attempted to lock a table without releasing previous lock first.
+ Attempted to lock a table without releasing previous lock first:
+ <p>Tables already locked:<br>[% current FILTER html %]
+ <p>Tables requesting locking:<br>[% new FILTER html %]
[% ELSIF error == "no_matching_lock" %]
Attempted to unlock tables without locking them first.