users@glassfish.java.net

Re: JCA question regarding transactions

From: <glassfish_at_javadesktop.org>
Date: Mon, 14 Jun 2010 07:26:29 PDT

> If the ejb is making use of resource-adapter using
> its resources (eg: connector-resource), then, making
> the resource-adapter to support transaction will
> ensure that all the operations done on the resource
> by the ejb will be part of the transaction.

And that's sort of my question. The "resource" in this case is Drools. The "connection factory" is really just a JCA-compliant implementation of the Drools KnowledgeBase interface. The "connection" is a StatefulKnowledgeSession which is created, used and disposed of in a single request, so for all intents and purposes is stateless.

BUT, you can hand the StatefulKnowledgeSession anything you want. You can hand it, for example, an EntityManager, and people who have written Drools rules can use it. What I'm trying to figure out is: will the invocation of the EntityManager "in" a "connection" as vended by a KnowledgeBase connection factory--will that EntityManager be subject to the transaction behavior of the EJB that passed it in in the first place, or will it be subject to the transaction behavior of the resource? By the time the EntityManager is used, the resource machinery has already done its thing. I just want to make sure that the EJB transaction is not somehow suspended.

Best,
Laird

> For more information, please refer Section 7
> "Transaction Management Contract" of Java EE
> Connector Architecture Specification 1.6/1.5
[Message sent by forum member 'ljnelson']

http://forums.java.net/jive/thread.jspa?messageID=474205