diff src/c/urweb.c @ 2177:00cf8214c2e3

Switching to a more dynamic method of handling database reconnection, restarting transactions
author Adam Chlipala <adam@chlipala.net>
date Sat, 17 Oct 2015 11:08:12 -0400
parents d2a98983f502
children c76a9712334c
line wrap: on
line diff
--- a/src/c/urweb.c	Sat Oct 17 10:49:25 2015 -0400
+++ b/src/c/urweb.c	Sat Oct 17 11:08:12 2015 -0400
@@ -811,12 +811,9 @@
     uw_error(ctx, FATAL, "Error reopening database connection");
 }
 
-int uw_try_reconnecting_if_at_most_one(uw_context ctx) {
-  if (ctx->at_most_one_query) {
-    uw_try_reconnecting(ctx);
-    return 1;
-  } else
-    return 0;
+void uw_try_reconnecting_and_restarting(uw_context ctx) {
+  uw_try_reconnecting(ctx);
+  uw_error(ctx, UNLIMITED_RETRY, "Restarting transaction after fixing database connection");
 }
 
 void uw_ensure_transaction(uw_context ctx) {