When a CannotAcquireResourceException is thrown because the data source is not available, the reason why this happened cannot be determined out of the exception. The reason is logged, but I would like to have this information available programmatically, preferrably directly out of the CannotAcquireResourceException.
Right now, the message of the exception only reads "A ResourcePool could not acquire a resource from its primary factory or source", which is not very helpful. The CannotAcquireResourceException already implements the PotentiallySecondary interface with its getNestedThrowable() method; could the primary SQLException why the connection could not be acquired be made available here?
Thanks in advance,
Log in to post a comment.