Fix typo in transactional contains()

This commit is contained in:
dsyer
2010-04-03 10:10:34 +00:00
parent f7d377908d
commit 39eafb8b78
2 changed files with 21 additions and 5 deletions

View File

@@ -164,11 +164,15 @@ public class TransactionAwareProxyFactory<T> {
}
Object result = invocation.getMethod().invoke(cache, invocation.getArguments());
String methodName = invocation.getMethod().getName();
if (appendOnly && result==null && (methodName.equals("get") || methodName.equals("contains"))) {
// In appendOnly mode the result of a get might not be in the cache...
return invocation.proceed();
if (appendOnly) {
String methodName = invocation.getMethod().getName();
if ((result == null && methodName.equals("get"))
|| (Boolean.FALSE.equals(result) && methodName.startsWith("contains"))) {
// In appendOnly mode the result of a get might not be
// in the cache...
return invocation.proceed();
}
}
return result;