The ThreadLocalTxManager has this method:
@Override
public <T> T txUnwrappedResult(UnitOfWorkCall<T> unit) throws Exception {
begin();
try {
T result = unit.call();
commit();
return result;
} catch (Exception e) {
rollback();
throw e;
}
}
Trouble is when unit throws an Error (for example: JUnit test with fail). The connection will not be released, there will be no commit or rollback.
In my very case, next test after the one which was calling fail was hanging forever because of this.
I think we need a finally clause here.
The
ThreadLocalTxManagerhas this method:Trouble is when
unitthrows anError(for example: JUnit test withfail). The connection will not be released, there will be nocommitorrollback.In my very case, next test after the one which was calling
failwas hanging forever because of this.I think we need a
finallyclause here.