diff src/c/http.c @ 1938:d02c1a0d8082

Proper handling of serialization failures during SQL COMMIT
author Adam Chlipala <adam@chlipala.net>
date Mon, 23 Dec 2013 15:59:17 +0000
parents 94f9570671f0
children 9f3597979e98
line wrap: on
line diff
--- a/src/c/http.c	Tue Dec 17 20:12:33 2013 -0500
+++ b/src/c/http.c	Mon Dec 23 15:59:17 2013 +0000
@@ -447,9 +447,10 @@
 }
 
 void uw_do_expunge(uw_context ctx, uw_Basis_client cli, void *data) {
-  uw_ensure_transaction(ctx);
-  uw_get_app(ctx)->expunger(ctx, cli);
-  uw_commit(ctx);
+  do {
+    uw_ensure_transaction(ctx);
+    uw_get_app(ctx)->expunger(ctx, cli);
+  } while (uw_commit(ctx) && (uw_rollback(ctx, 1), 1));
 }
 
 void uw_post_expunge(uw_context ctx, void *data) {