MODE-2395 - Added Arquillian integration test to reporduce the issue described in MODE-2395

Added Arquillian test to recreate the issue described in MODE-2395. When running the test please ensure that standalone-modeshape.xml has the following Infinispan cache configuration:

<local-cache name="sample">
    <locking isolation="READ_COMMITTED" striping="false"/>
    <transaction mode="NON_XA" locking="PESSIMISTIC"/>
    <file-store passivation="false" purge="false" path="modeshape/store/sample"/>
</local-cache>
The session is managed by CDI and is request scoped.

Every call running on the test thread is part of the same request and uses the same session. 

The thread that executes the Async EJB method is a separate request and has its own session. 

I verified this when debugging the issue by logging the session ids but removed the logging before committing the PR.

> On Dec 10, 2014, at 6:52 AM, Randall Hauch <notifications@github.com> wrote:
> 
> In integration/modeshape-jbossas-integration-tests/src/main/java/org/modeshape/test/integration/StatelessCMTBean.java:
> 
> > +import javax.inject.Inject;
> > +import javax.jcr.Node;
> > +import javax.jcr.RepositoryException;
> > +import javax.jcr.Session;
> > +import java.util.UUID;
> > +
> > +/**
> > + * A stateless EJB that uses container managed transactions
> > + *
> > + * @author Richard Lucas
> > + */
> > +@Stateless
> > +public class StatelessCMTBean {
> > +
> > +    @Inject
> > +    Session session;
> Is a new session injected on each method call, or are the sessions reused from call to call?
> 
> —
> Reply to this email directly or view it on GitHub.
>