From 85da2e609cea37f70d69f9c4451a610e40836bdc Mon Sep 17 00:00:00 2001 From: mdb Date: Wed, 20 Aug 2008 16:45:52 +0000 Subject: [PATCH] We surely want to not run a transition if we try to note it and discover that another process has noted it first. git-svn-id: https://samskivert.googlecode.com/svn/trunk@2367 6335cc39-0255-0410-8fd6-9bcaacd3b74c --- src/java/com/samskivert/jdbc/TransitionRepository.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/java/com/samskivert/jdbc/TransitionRepository.java b/src/java/com/samskivert/jdbc/TransitionRepository.java index fe1f650e..401da80d 100644 --- a/src/java/com/samskivert/jdbc/TransitionRepository.java +++ b/src/java/com/samskivert/jdbc/TransitionRepository.java @@ -65,8 +65,7 @@ public class TransitionRepository extends SimpleRepository public void transition (Class clazz, String name, Transition trans) throws PersistenceException { - if (!isTransitionApplied(clazz, name)) { - noteTransition(clazz, name); + if (!isTransitionApplied(clazz, name) && noteTransition(clazz, name)) { try { trans.run(); @@ -92,7 +91,7 @@ public class TransitionRepository extends SimpleRepository } /** - * Has the specified name transition been applied. + * Returns whether the specified name transition been applied. */ public boolean isTransitionApplied (Class clazz, final String name) throws PersistenceException