anchor.diff:          Else -> couch_db:close(Else)
       end,
   
  +    case NewGroup#group.db of
  +        nil -> ok;
  +        _ -> couch_db:close(NewGroup#group.db)
  +    end,
  +
       self() ! delayed_commit,
       {noreply, State#group_state{
  -        group=NewGroup,
  +        group=NewGroup#group{db = nil},
           ref_counter=NewRefCounter,
           compactor_pid=nil,
           updater_pid=NewUpdaterPid
  
positive.code: 
  handle_info({'EXIT', FromPid, Reason}, State) ->
      ?LOG_DEBUG("Exit from linked pid: ~p", [{FromPid, Reason}]),
      {stop, Reason, State};
  
  handle_info({'DOWN',_,_,_,_}, State) ->
      ?LOG_INFO("Shutting down view group server, monitored db is closing.", []),
      {stop, normal, reply_all(State, shutdown)}.
  
  
  terminate(Reason, #group_state{updater_pid=Update, compactor_pid=Compact}=S) ->
      couch_db_update_notifier:stop(S#group_state.db_update_notifier),
      reply_all(S, Reason),
      couch_util:shutdown_sync(Update),
      couch_util:shutdown_sync(Compact),
  
negative.code:         ViewStates2, Views),
      Group#group{db=Db, fd=Fd, current_seq=Seq, purge_seq=PurgeSeq,
          id_btree=IdBtree, views=Views2}.
  