• R/O
  • HTTP
  • SSH
  • HTTPS

newslash: Commit

newslash


Commit MetaInfo

Revisãof10420c032bb962bb0e14439115c94e75b86ac35 (tree)
Hora2019-03-06 22:03:43
Autorhylom <hylom@user...>
Commiterhylom

Mensagem de Log

Model::WebMessages: fix transaction related problems

Mudança Sumário

Diff

--- a/src/newslash_web/lib/Newslash/Model/WebMessages.pm
+++ b/src/newslash_web/lib/Newslash/Model/WebMessages.pm
@@ -101,12 +101,11 @@ INSERT INTO message_web
101101 (?, ?, ?, ?, NOW())
102102 EOSQL
103103
104- # TODO: transaction_?
105104 my $dbh = $self->start_transaction;
106105 my $sth = $dbh->prepare($sql);
107106 my $rs = $sth->execute($id, $uid, $from_uid, $code);
108107 if (!$rs) {
109- # TODO: transaction_?
108+ $self->rollback;
110109 return;
111110 }
112111
@@ -119,9 +118,10 @@ EOSQL
119118 $sth = $dbh->prepare($sql);
120119 $rs = $sth->execute($id, $title, $body);
121120 if (!$rs) {
122- # TODO: transaction_?
121+ $self->rollback;
123122 return;
124123 }
124+ $self->commit;
125125 return $id;
126126 }
127127
Show on old repository browser