summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorFilipe David Borba Manana <fdmanana@apache.org>2010-11-18 21:07:39 +0000
committerFilipe David Borba Manana <fdmanana@apache.org>2010-11-18 21:07:39 +0000
commita8c8aac826a3d86bef3ca169d7f379cef4c4016f (patch)
tree7abe04cb886667dcaa648187e29467a1fb580a98 /src
parent1c41d9cce36a414e10ff3ab741c504a03f6c297f (diff)
Merged revision 1036627 from trunk:
Preserve user context when reopening a database. git-svn-id: https://svn.apache.org/repos/asf/couchdb/branches/1.0.x@1036629 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src')
-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),