diff options
author | 2009-04-05 12:05:19 -0400 | |
---|---|---|
committer | 2009-04-05 12:05:19 -0400 | |
commit | 60a994326dab3c23d7dd7ab9ff4538c06329e277 (patch) | |
tree | ce519c2322c30780cc4a8cfe9f6f772b47719bc1 /src/c/driver.c | |
parent | 3b3f14a1c2021f307e9290ec8fba64d6c791a93a (diff) |
Initialize contexts a little more vigorously
Diffstat (limited to 'src/c/driver.c')
-rw-r--r-- | src/c/driver.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/c/driver.c b/src/c/driver.c index 44465cc3..c5e1ba33 100644 --- a/src/c/driver.c +++ b/src/c/driver.c @@ -306,12 +306,19 @@ static void sigint(int signum) { static void initialize() { uw_context ctx = new_context(); + failure_kind fk; if (!ctx) exit(1); - if (uw_initialize(ctx) != SUCCESS) { - printf("Failed to initialize database!\n"); + for (fk = uw_initialize(ctx); fk == UNLIMITED_RETRY; fk = uw_initialize(ctx)) { + printf("Unlimited retry during init: %s\n", uw_error_message(ctx)); + uw_db_rollback(ctx); + uw_reset(ctx); + } + + if (fk != SUCCESS) { + printf("Failed to initialize database! %s\n", uw_error_message(ctx)); uw_db_rollback(ctx); exit(1); } |