diff options
Diffstat (limited to 'src/main/java/com/amazon')
-rw-r--r-- | src/main/java/com/amazon/carbonado/OptimisticLockException.java | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/src/main/java/com/amazon/carbonado/OptimisticLockException.java b/src/main/java/com/amazon/carbonado/OptimisticLockException.java index b4a43de..949537e 100644 --- a/src/main/java/com/amazon/carbonado/OptimisticLockException.java +++ b/src/main/java/com/amazon/carbonado/OptimisticLockException.java @@ -72,16 +72,10 @@ public class OptimisticLockException extends PersistException { }
private static String makeMessage(Object expectedVersion, Object savedVersion) {
- if (expectedVersion == null) {
- if (savedVersion == null) {
- return null;
- }
- return "Failed to update because saved version is " + savedVersion;
+ if (expectedVersion == null && savedVersion == null) {
+ return null;
}
- if (savedVersion == null) {
- return "Failed to update for expected version " + expectedVersion;
- }
- return "Failed to update for expected version " + expectedVersion +
- " because saved version is " + savedVersion;
+ return "Update acted on version " + expectedVersion +
+ ", but canonical version is " + savedVersion;
}
}
|