Skip to content

Commit

Permalink
Hotfix for database transaction lock problem
Browse files Browse the repository at this point in the history
This fix adds some commits to write statements to the SECRET and
DATAPOOL tables which resulted in stalled transactions in certain
circumstances, causing lockups on the user frontend.
  • Loading branch information
mbartosch committed Oct 10, 2012
1 parent bda346f commit 9b853b6
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -469,6 +469,7 @@ sub clear_secret_group
DATA => {
PKI_REALM => $realm,
GROUP_ID => $group});
CTX('dbi_backend')->commit();
}
}
delete $self->{SECRET}->{$realm}->{$group};
Expand Down
7 changes: 7 additions & 0 deletions trunk/perl-modules/core/trunk/OpenXPKI/Server/API/Object.pm
Original file line number Diff line number Diff line change
Expand Up @@ -752,6 +752,7 @@ sub get_data_pool_entry {
GROUP_ID => $encryption_key,
},
);
CTX('dbi_backend')->commit();
};

} else {
Expand Down Expand Up @@ -1013,6 +1014,7 @@ sub modify_data_pool_entry {
DATA => \%values,
WHERE => \%condition,
);
CTX('dbi_backend')->commit();

return 1;
}
Expand Down Expand Up @@ -1060,6 +1062,7 @@ sub __set_data_pool_entry : PRIVATE {
%key,
},
);
CTX('dbi_backend')->commit();
};
return 1;
}
Expand Down Expand Up @@ -1225,6 +1228,7 @@ sub __set_data_pool_entry : PRIVATE {
WHERE => \%key,
);
if ($rows_updated) {
CTX('dbi_backend')->commit();
return 1;
}
# no rows updated, so no data existed before, continue with insert
Expand All @@ -1238,6 +1242,7 @@ sub __set_data_pool_entry : PRIVATE {
%values,
},
);
CTX('dbi_backend')->commit();
};
if (my $exc = OpenXPKI::Exception->caught()) {
if ($exc->message()
Expand Down Expand Up @@ -1276,6 +1281,7 @@ sub __cleanup_data_pool : PRIVATE {
DATA => {
NOTAFTER => [ '<', time ],
});
CTX('dbi_backend')->commit();
return 1;
}

Expand Down Expand Up @@ -1419,6 +1425,7 @@ sub __get_current_datapool_encryption_key : PRIVATE {
GROUP_ID => $associated_vault_key_id,
},
);
CTX('dbi_backend')->commit();
};

}
Expand Down

0 comments on commit 9b853b6

Please sign in to comment.