We have a situation where connections to our datasource sometimes will hang, and if we stack up a bunch of these connections it will use up all available threads for our JVM. We have implemented our own custom data source (a proxy to a regular data source) to implement throttling so that if we notice a bunch of connections starting to take a long time to respond, we will stop accepting new requests (and fail quickly) such that we avoid the condition that hangs the entire JVM.
Does Hibernate have any ability to throttle connections in this way "natively", or should we continue to use our custom data source?
|