hibernate c3p0 ThreadPoolExecutor Connection pooling, am I doing it right?
问题 I am using hibernate and c3p0 for the database, and i have an java application, with ThreadPoolExecutor. What i am doing is, I am enquing different Tasks each related to hibernate, to store data with Hibernate using Transactions, and getCurrentSession. So I have new ThreadPoolExecutor(CORE_POOL_SIZE, MAX_POOL_SIZE, KEEP_ALIVE_TIME, TimeUnit.MINUTES,taskQueue); Runnable { @Override public void run() { Session session = HibernateDAO.getInstance().getCurrentSession(); Transaction tx = null; try