summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEvan Prodromou <evan@zhora.(none)>2009-01-20 08:19:32 -0500
committerEvan Prodromou <evan@zhora.(none)>2009-01-20 08:19:32 -0500
commit4873277b58941ae6ec16543f437f4267ccab5ac0 (patch)
tree8baa07ba431a79e10853a8a0ea6e5361632d56db
parentaf2fb7dff2c9f94777d9d262f7a6d0427da65217 (diff)
Wrap notice-saving code in a transaction
-rw-r--r--classes/Notice.php4
1 files changed, 4 insertions, 0 deletions
diff --git a/classes/Notice.php b/classes/Notice.php
index d614ceeba..281696632 100644
--- a/classes/Notice.php
+++ b/classes/Notice.php
@@ -125,6 +125,8 @@ class Notice extends Memcached_DataObject
$notice->is_local = $is_local;
}
+ $notice->query('BEGIN');
+
$notice->reply_to = $reply_to;
$notice->created = common_sql_now();
$notice->content = common_shorten_links($content);
@@ -158,6 +160,8 @@ class Notice extends Memcached_DataObject
// Add to notice inboxes
$notice->addToInboxes();
+
+ $notice->query('COMMIT');
# Clear the cache for subscribed users, so they'll update at next request
# XXX: someone clever could prepend instead of clearing the cache