There is a race condition in Atlassian's OfBiz Entity Engine fork that can result in connections being detected incorrectly as abandoned when they are actually still in use. This is due to certain allowed changes to object visibility as a result of just-in-time compiler optimizations, with the result that the connection is enqueued as abandoned just before the thread that is using it closes it.
The most common manifestation of this is a warning message about an abandoned SQL processor:
This is particularly likely under heavy use (such as when reindexing) and when the connection is opened and closed in a small function that is likely to inline these operations, such as this from JCHART (leading to JCHART-462 as a result):
In the most extreme cases (typically under heavy load) it is even possible for the connection to be closed by another thread before its connection commits, with actual failed operations as a result:
This is why using a ReadOnlySQLProcessor works around the problem; the read-only connections do not attempt to commit, so the fact that it was already closed by another thread makes no difference.
For the technically savvy, there is a reasonably good and detailed explanation of this rather subtle problem in this blog post. The fix is to reorder the volatile writes and the release of the connection guard in such a way as to disallow the visibility change.