comparison src/c/urweb.c @ 1939:c52365a4ce41

No need to ROLLBACK after a failed COMMIT
author Adam Chlipala <adam@chlipala.net>
date Wed, 25 Dec 2013 11:43:41 -0500
parents d02c1a0d8082
children 9f3597979e98
comparison
equal deleted inserted replaced
1938:d02c1a0d8082 1939:c52365a4ce41
3281 return 0; 3281 return 0;
3282 } 3282 }
3283 } 3283 }
3284 3284
3285 if (ctx->transaction_started) { 3285 if (ctx->transaction_started) {
3286 int code =ctx->app->db_commit(ctx); 3286 int code = ctx->app->db_commit(ctx);
3287 3287
3288 if (code) { 3288 if (code) {
3289 if (code == -1) { 3289 if (code == -1)
3290 uw_rollback(ctx, 1);
3291 return 1; 3290 return 1;
3292 }
3293 3291
3294 for (i = ctx->used_transactionals-1; i >= 0; --i) 3292 for (i = ctx->used_transactionals-1; i >= 0; --i)
3295 if (ctx->transactionals[i].free) 3293 if (ctx->transactionals[i].free)
3296 ctx->transactionals[i].free(ctx->transactionals[i].data, 0); 3294 ctx->transactionals[i].free(ctx->transactionals[i].data, 0);
3297 3295