用了ThreadLocal,connection对象是不是只有一个?
每个线程的threadLocals中保存的都是connection对象的副本?
这样的理解是正确的么?
connection对象可以共用么?
巴扎黑2017-04-18 09:53:53
With ThreadLocal connection, it is not the same.
Every thread keeps a copy of itself.
Connection objects are generally used by a single thread. No concurrent calls across threads.
PHP中文网2017-04-18 09:53:53
"Each thread keeps a copy of itself", why not use a connection pool to manage it?