creating database connections for each CPU thread