BATCH-1620: fix bugs in TX aware proxy

This commit is contained in:
dsyer
2010-09-04 10:37:41 +00:00
parent 939d9a1914
commit 48ce91f5d0
5 changed files with 12 additions and 8 deletions

View File

@@ -168,11 +168,16 @@ public class TransactionAwareProxyFactory<T> {
if (appendOnly) {
String methodName = invocation.getMethod().getName();
if ((result == null && methodName.equals("get"))
|| (Boolean.FALSE.equals(result) && methodName.startsWith("contains"))) {
|| (Boolean.FALSE.equals(result) && (methodName.startsWith("contains")) || (Boolean.TRUE.equals(result) && methodName.startsWith("isEmpty")))) {
// In appendOnly mode the result of a get might not be
// in the cache...
return invocation.proceed();
}
if (result instanceof Collection<?>) {
HashSet<Object> set = new HashSet<Object>((Collection<?>) result);
set.addAll((Collection<?>) invocation.proceed());
result = set;
}
}
return result;