You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@jackrabbit.apache.org by mmjose26 <mm...@yahoo.com.mx> on 2011/07/20 20:28:50 UTC

Is it possible to have both asynchronous listener and Jta Transaction?

Hi, I want to have both, but when I enable JTA transaction, the onEvent
method are not called. 
And if possible, I want to versioning all nodes added to repository in 
asynchronous listener. 

here the script code:



                        boolean enableTransaction=true;
                        ObservationManager obsManager =
session.getWorkspace().getObservationManager();
                        obsManager.addEventListener(new  
DummyEventListener(),Event.NODE_ADDED,"/",true,null,null,false);
                        if (enableTransaction){
                            XASession xasession = (XASession) session;
                           
transaction.enlistResource(xasession.getXAResource());
                            } 
                        }
...
adding node
...
...
session.save();


the begin and commit transaction is performed by Spring
JtaTransactionManager.


Any help would be appreciated.

Thanks, 

--
View this message in context: http://jackrabbit.510166.n4.nabble.com/Is-it-possible-to-have-both-asynchronous-listener-and-Jta-Transaction-tp3681731p3681731.html
Sent from the Jackrabbit - Users mailing list archive at Nabble.com.

Re: Is it possible to have both asynchronous listener and Jta Transaction?

Posted by mmjose26 <mm...@yahoo.com.mx>.
I'm using Spring Modules jcr, and debugging the source code  I found that
session.logout() is called before to commit the transaction. I modified the
source code of spring modules, so that session.logout() be called AFTER to
commit, and now listeners works fine().  

--
View this message in context: http://jackrabbit.510166.n4.nabble.com/Is-it-possible-to-have-both-asynchronous-listener-and-Jta-Transaction-tp3681731p3684945.html
Sent from the Jackrabbit - Users mailing list archive at Nabble.com.