Author: dan.j.allen
Date: 2009-07-17 18:10:55 -0400 (Fri, 17 Jul 2009)
New Revision: 3082
Modified:
ri/trunk/impl/src/main/java/org/jboss/webbeans/conversation/ConversationImpl.java
Log:
throw IllegalStateException if begin() called on long-running or end() called on transient
conversation
Modified:
ri/trunk/impl/src/main/java/org/jboss/webbeans/conversation/ConversationImpl.java
===================================================================
---
ri/trunk/impl/src/main/java/org/jboss/webbeans/conversation/ConversationImpl.java 2009-07-17
21:26:24 UTC (rev 3081)
+++
ri/trunk/impl/src/main/java/org/jboss/webbeans/conversation/ConversationImpl.java 2009-07-17
22:10:55 UTC (rev 3082)
@@ -91,6 +91,10 @@
public void begin()
{
+ if (isLongRunning())
+ {
+ throw new IllegalStateException("Attempt to call begin() on a long-running
conversation");
+ }
log.debug("Promoted conversation " + cid + " to
long-running");
longRunning = true;
}
@@ -109,6 +113,10 @@
public void end()
{
+ if (!isLongRunning())
+ {
+ throw new IllegalStateException("Attempt to call end() on a transient
conversation");
+ }
log.debug("Demoted conversation " + cid + " to transient");
longRunning = false;
}
Show replies by date