David Glasser wrote:
> My guess is that we need to rollback the transaction on error. So
> rewrite all the SVN_ERRs to be if/goto cleanup, or wrap commit_body in
> a little function like:
>
> svn_error_t *
> commit_exoskeleton(void *baton, apr_pool_t *pool)
<bikeshed>
I've so far seen these things named *_wrapper... Or, in this instance, I'd
give the "outside" function the simpler name as in commit_body() and the
inner function e.g. commit_body_helper(), commit_body_internal(), ...
</bikeshed>
~Neels
> {
> struct commit_baton *cb = baton;
> fs_fs_data_t *ffd = cb->fs->fsap_data;
> svn_sqlite__db_t *db = ffb->rep_cache.db;
> svn_error_t *err;
>
> /* Start the sqlite transaction. */
> if (db)
> SVN_ERR(svn_sqlite__transaction_begin(db));
>
> err = commit_body(cb, pool);
>
> if (db)
> {
> if (err)
> svn_error_clear(svn_sqlite__transaction_rollback(db));
> else
> return svn_sqlite__transaction_commit(db);
> }
> return err;
> }
>
> --dave
Received on 2008-11-12 02:12:30 CET