Moved responsibility for opening and closing db to adapters.