As of now ConnectionManager is a mess, really hard to understand. We should refactor it.
Also ThreadLocal connection is a root cause of complicated behavior of local queries & map queries.
I guess we have to use simple connection pool.
For better performance connection pools will be striped by Thread ID.