Fixed connection pool locking.
fixed warning
Removed some unnecessary code.
Fixed adapter registration and implemented adapter mocking in tests.