Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

#79 throw in ConnectionCustomizer::onCheckOut is bad

open
nobody
None
5
2010-01-08
2010-01-08
Joshua Pritikin
No

The ConnectionCustomizer interface for onCheckOut throw Exception. However, checkoutResource at BasicResourcePool.java line 474 has the comment "This function recursively calls itself... under nonpathological situations, it shouldn't be a problem, but if resources can never successfully check out for some reason, we might blow the stack..." In other words, throwing an exception in ConnectionCustomizer.onCheckOut will cause StackOverflowError. I suggest removing "throw Exception" from the ConnectionCustomizer interface or coping with exceptions in BasicResourcePool more gracefully.

Discussion