From a8c8aac826a3d86bef3ca169d7f379cef4c4016f Mon Sep 17 00:00:00 2001 From: Filipe David Borba Manana Date: Thu, 18 Nov 2010 21:07:39 +0000 Subject: 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 --- src/couchdb/couch_db.erl | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src') 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), -- cgit v1.2.3