Open GoogleCodeExporter opened 9 years ago
Patch attached to issue 730 which addresses this.
It doesn't expose the isWorking method, but rather introduces an
invocation-counting mechanism to JpaPersistService so that begin()/end() calls
can be nested safely.
Original comment by spootsy....@gmail.com
on 10 Oct 2012 at 11:46
I haven't used the @UnitOfWork part of this patch, but I don't think the fix in
JpaPersistService where it increments and decrements the count is working
correctly.
I thrashed the service with soapUI using a load test on several service(all
using PersistFilter) in my app simultaneously. I'm not sure how, since it's a
ThreadLocal variable, but that count quickly get out of whack. As a result not
all entity managers are getting closed and the connection pool eventually runs
out of connections. Works fine with one thread.
Perhaps it's not handling nested @Transactions correctly. I wasted a lot of
time trying get this patch working.
Original comment by julian.w...@gmail.com
on 25 Jul 2013 at 3:22
Hi @julian,
Thanks for trying out the patch. Sorry to hear you had problems with it.
Having had a look at the patch with fresh eyes, you hit the nail on the head.
Nested transactions call "unitOfWork.begin()", but not "unitOfWork.end()",
which would cause the problem you saw.
I'll post an updated patch when I get a chance. I've searched for any other
possible mismatched begin/end calls, but that's the only one.
It should be an easy fix if you want to do it yourself. In
JpaLocalTxnInterceptor, just add a try/finally block around line 56, so it
becomes:
try {
return methodInvocation.proceed();
} finally {
unitOfWork.end();
}
Hope that helps some :)
Original comment by spootsy....@gmail.com
on 30 Jul 2013 at 1:53
Original comment by sberlin
on 20 Dec 2013 at 2:16
Original issue reported on code.google.com by
spootsy....@gmail.com
on 5 Oct 2012 at 4:28