diff options
author | Filipe David Borba Manana <fdmanana@apache.org> | 2010-11-18 21:07:39 +0000 |
---|---|---|
committer | Filipe David Borba Manana <fdmanana@apache.org> | 2010-11-18 21:07:39 +0000 |
commit | a8c8aac826a3d86bef3ca169d7f379cef4c4016f (patch) | |
tree | 7abe04cb886667dcaa648187e29467a1fb580a98 | |
parent | 1c41d9cce36a414e10ff3ab741c504a03f6c297f (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
-rw-r--r-- | src/couchdb/couch_db.erl | 10 |
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), |