users@glassfish.java.net

Re: JCA question regarding transactions

From: <glassfish_at_javadesktop.org>
Date: Tue, 15 Jun 2010 19:09:23 PDT

I'm not sure what you mean. Neither of them by themselves affects anything. A KnowledgeBase produces sessions of either a stateful or stateless variety. In my case, I'm using a stateful session for lots of reasons, but you'll notice it's fully disposed of, rendering its lifetime equal to the lifetime of the EJB.

So, again, all they do is take facts (insert()ed by the bean) and evaluate them against rules (glorified patterns), and, if they match, the rules' consequences are run. The rule consequences can do pretty much anything they want--they're just Java.

As it happens, none of my rule consequences do anything that lasts beyond the lifespan of the session [i]except[/i]--perhaps--interacting with the supplied EntityManager.

The EntityManager, of course, is handed to the rules engine as you can see from the EJB that houses both.

Again, I'm curious about what happens when a resource adapter that is declared to have no transaction support is used by a bean that is declared to require a transaction, especially when edge cases crop up like this one--where we pass in an artifact from EJB land into Resource Adapter land.

Best,
Laird
[Message sent by forum member 'ljnelson']

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