Programmatically Configure Hibernate (JPA) with DBCP

I recently had deadlock issues with c3p0 and statement caching. Long story short, after investigating c3p0 code, I decided to switch to DBCP (maybe I’ll write a post with the long story).

I am not a big fan of Spring (here again, maybe I’ll write a post about that). If you are like me, here is how to programmatically configure Hibernate (JPA) to use DBCP, without Spring and without JNDI.

With DBCP, all my deadlock issues disappeared. Thank you ASF.