I\'m running a Spring/Hibernate connecting to MySQL setup using c3p0 as my connection pool. For some bizarre reason it runs out of connections when the system is under load (of
It's pretty unlikely that @Transactional
leaks connections - otherwise, your site would stop working after the first 100 requests.
But there is another reason why this happens:
Maybe you have set a timeout for "dead" connections and some queries take longer than that. That means that your pool removed a busy connection as "dead" from the pool and requests another from the DB - until the DB pulls the plug.
To debug this, enable logging for your connection pool, so you can see when it requests new connections.