"adrian(a)jboss.org" wrote :
| The fix is to replace isManagedConnectionFree() with wasManagedConnectionFreed().
| i.e. the managed connection might now be free, but it wasn't us that freed it
| => do it only once
|
Of course, that's only a logical description of what it should do.
In practice the code is more complicated.
But the key part is to have some synchronized block that maintains/checks
the free state.
e.g. something like
| synchronized boolean isFreed(...)
| {
| boolean wasFree = isManagedConnectionFree();
| // change state, e.g. #handles or track-by-tx
| if (wasFree)
| return false; // This shouldn't really happen now all the state is changed
atomically
| else
| return isManagedConnectionFree(); // We just freed it
| }
|
| if (isFreed(...))
| returnManagedConnection();
|
View the original post :
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4166398#...
Reply to the post :
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&a...