Re: Locks with try/finally

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

Re: Locks with try/finally

Chris Burnley
If find the best way to do it is something like this:

Connection connection = ds.getConnection();
try {
finally {

If getConnection fails and throws an exception then flow control will
never go below this line and hence there is no risk of nullpointer in
the finally.

Concurrency-interest mailing list
[hidden email]