IllegalArgumentException on c3p0 minSize below 1 in Hibernate
0 reputation · 10 Dec 2023, 20:18 UTC
Cost reduction for low-traffic Hibernate with c3p0
Reducing idle resource consumption in low-traffic Hibernate applications is a documented cost optimization target. The c3p0 pool defaults to three initial connections, which can exceed actual concurrency needs for sporadic workloads.
minSize governs the minimum connections retained. A documented failure condition is IllegalArgumentException when minSize is set below 1. Pool behavior also varies with driver-specific connection establishment costs and transaction patterns, and database limits apply regardless of pool settings. The optimal minSize remains unresolved across drivers.
Specific questions:
- What documented constraints govern the valid range for c3p0 minSize relative to maxSize?
- How does minSize interact with connection validation on startup for low-traffic workloads?
- Which metrics indicate when a reduced minSize introduces connection establishment latency?