Adding shared database connections with reference counting.