summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/couchdb/couch_db.erl10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/couchdb/couch_db.erl b/src/couchdb/couch_db.erl
index fe155abe..964c4704 100644
--- a/src/couchdb/couch_db.erl
+++ b/src/couchdb/couch_db.erl
@@ -87,17 +87,17 @@ open(DbName, Options) ->
Else -> Else
end.
-reopen(#db{main_pid = Pid, fd_ref_counter = OldRefCntr}) ->
+reopen(#db{main_pid = Pid, fd_ref_counter = OldRefCntr, user_ctx = UserCtx}) ->
{ok, #db{fd_ref_counter = NewRefCntr} = NewDb} =
gen_server:call(Pid, get_db, infinity),
case NewRefCntr =:= OldRefCntr of
true ->
- {ok, NewDb};
+ ok;
false ->
couch_ref_counter:add(NewRefCntr),
- couch_ref_counter:drop(OldRefCntr),
- {ok, NewDb}
- end.
+ couch_ref_counter:drop(OldRefCntr)
+ end,
+ {ok, NewDb#db{user_ctx = UserCtx}}.
ensure_full_commit(#db{update_pid=UpdatePid,instance_start_time=StartTime}) ->
ok = gen_server:call(UpdatePid, full_commit, infinity),