[
https://issues.jboss.org/browse/AS7-1995?page=com.atlassian.jira.plugin.s...
]
Carlo de Wolf commented on AS7-1995:
------------------------------------
http://java.net/projects/ejb-spec/lists/jsr345-experts/archive/2011-10/me...
Amendment for "The SessionContext Interface":
{quote}
If a business method is called on such reference from the same session bean that called
getBusinessObject method, unless the bean supports reentrant calls, a container will use a
different stateless session bean instance either from the pool or will create a new
instance to serve the request. For the stateful session beans and singleton session beans
the returned reference will be for the same instance, and the bean must support reentrant
calls to call a method on it.
{quote}
Re-entrant call into SFSB invalidly blocks
------------------------------------------
Key: AS7-1995
URL:
https://issues.jboss.org/browse/AS7-1995
Project: Application Server 7
Issue Type: Bug
Components: EJB
Environment:
https://github.com/wolfc/jboss-as/tree/reentrant
Reporter: Carlo de Wolf
Assignee: Carlo de Wolf
Fix For: 7.1.0.CR1
Calling a method on the proxy returned by SessionContext.getBusinessObject(Class) can
lead to incorrect ConcurrentAccess(Timeout)Exceptions.
{code}
@Stateful
public class ReentrantStatefulBean {
@Resource
private SessionContext ctx;
private Object state;
@TransactionAttribute(NEVER)
public void callMe() {
this.state = new Date().toString();
ctx.getBusinessObject(ReentrantStatefulBean.class).check(this.state);
}
@TransactionAttribute(REQUIRED)
public void check(final Object check) {
if (this.state != check)
throw new IllegalStateException("EJB 3.1 FR 21.2 I'm not being
myself today");
}
}
{code}
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:
https://issues.jboss.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see:
http://www.atlassian.com/software/jira