Fix how cache manager is passed to connection.
Merge branch '4.0'