diff options
author | Filipe David Borba Manana <fdmanana@apache.org> | 2010-11-18 21:06:54 +0000 |
---|---|---|
committer | Filipe David Borba Manana <fdmanana@apache.org> | 2010-11-18 21:06:54 +0000 |
commit | 8c607abe413839f428a6a7209aab385b0fa22308 (patch) | |
tree | f698b04fe7bf69e0777b6004c7c86c3dabb6ed77 /src/couchdb | |
parent | 7d00abc0d7888b81fa5ff8149a2fd78e76aa4114 (diff) |
Preserve user context when reopening a database.
git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@1036627 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/couchdb')
-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 c8a93c26..03341bdd 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), |