You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@geronimo.apache.org by David Jencks <da...@yahoo.com> on 2010/05/01 00:54:25 UTC

Re: geronimo 2.1.4 container managed transaction

On Apr 30, 2010, at 2:05 PM, Anshuk wrote:

> 
> Ok David.
> 
> Let me elaborate the scenario.
> 
> I am deploying an ear..having the web & the ejb.The web part contains some
> web screens..(some jsps)..from which I am doing some inserts/updates..while
> doing so..the ejb is invoked which does the inert/update operations...the
> database used is oracle..the connection pool is used..for doing so..the
> TranQL Generic JDBC Resource Adapter is used..
> Now by default..setautocommit is always set to true..which we are setting to
> false (reason being in case of rollback using container managed transaction,
> the transaction should not be commited but rolled back) from the
> application.
> 
> So when I am doing an insert..the row is not commited..even if it is done
> correct insert..with no exceptions...
> 
> Do I need to change the tranql adapter? Can you advise.

You should use the latest tranql oracle wrapper instead of the generic wrapper.  I'm not sure the latest one is distributed with g. 2.14, but it's here:

http://repo1.maven.org/maven2/org/tranql/tranql-connector-oracle-local/1.5/tranql-connector-oracle-local-1.5.rar

Again, use the correct tranql wrapper, and don't call setAutocommit() in your code.  If you really have to use the generic wrapper, set the property CommitOnAutocommit to true.

thanks
david jencks

> 
> Anshuk
> -- 
> View this message in context: http://apache-geronimo.328035.n3.nabble.com/geronimo-2-1-4-container-managed-transaction-tp768780p768879.html
> Sent from the Users mailing list archive at Nabble.com.


Re: geronimo 2.1.4 container managed transaction

Posted by Anshuk <An...@infosys.com>.
No David. My mistake, the application was not built properly, it is now
working correctly as expected, with requires new.


Thanks so much for your effort.

Anshuk
-- 
View this message in context: http://apache-geronimo.328035.n3.nabble.com/geronimo-2-1-4-container-managed-transaction-tp768780p780370.html
Sent from the Users mailing list archive at Nabble.com.

Re: geronimo 2.1.4 container managed transaction

Posted by David Jencks <da...@yahoo.com>.
Are you sure your ejb method is configured with RequiresNew rather than Mandatory?  The stack trace indicates that by the time the xml configuration is translated into component configuration the method you are calling is configured as Mandatory.

david jencks

On May 4, 2010, at 8:13 PM, Anshuk wrote:

> 
> Hello All,
> 
> I am able to create the database pool using the tranql resource adapter for
> oracle local. 
> 
> Now if the ejb is configured with the RequiresNew, and the method in the ejb
> is being invoked from a web client in the ear as such, I am getting an
> error:
> 
> javax.ejb.TransactionRequiredLocalException
> 	at
> org.apache.openejb.core.ivm.BaseEjbProxyHandler.convertException(BaseEjbProxyHandler.java:341)
> 	at
> org.apache.openejb.core.ivm.BaseEjbProxyHandler.invoke(BaseEjbProxyHandler.java:323)
> 	at
> org.apache.openejb.util.proxy.Jdk13InvocationHandler.invoke(Jdk13InvocationHandler.java:49)
> 	at $Proxy47.createUserSession(Unknown Source)
> 	at
> com.testing.app.common.pm.UserClientHelper.createUserSession(UserClientHelper.java:749)
> 	at
> com.testing.app.common.manager.appUserManager.createUserSession(appUserManager.java:465)
> 	at
> com.testing.app.common.presentation.action.LoginAction.Submit(LoginAction.java:341)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> 	at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> 	at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> 	at java.lang.reflect.Method.invoke(Method.java:585)
> 	at
> com.opensymphony.xwork2.DefaultActionInvocation.invokeAction(DefaultActionInvocation.java:404)
> 	at
> com.opensymphony.xwork2.DefaultActionInvocation.invokeActionOnly(DefaultActionInvocation.java:267)
> 	at
> com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:229)
> 	at
> com.opensymphony.xwork2.interceptor.DefaultWorkflowInterceptor.doIntercept(DefaultWorkflowInterceptor.java:221)
> 	at
> com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:86)
> 	at
> com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)
> 	at
> com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)
> 	at
> com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)
> 	at
> com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)
> 	at
> com.opensymphony.xwork2.interceptor.PrepareInterceptor.doIntercept(PrepareInterceptor.java:121)
> 	at
> com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:86)
> 	at
> com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)
> 	at
> com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)
> 	at
> com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)
> 	at
> com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)
> 	at
> com.testing.app.common.presentation.interceptor.appManagerInterceptor.intercept(appManagerInterceptor.java:31)
> 	at
> com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)
> 	at
> com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)
> 	at
> com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)
> 	at
> com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)
> 	at
> com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:167)
> 	at
> com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:86)
> 	at
> com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)
> 	at
> com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)
> 	at
> com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)
> 	at
> com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)
> 	at
> com.opensymphony.xwork2.interceptor.StaticParametersInterceptor.intercept(StaticParametersInterceptor.java:105)
> 	at
> com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)
> 	at
> com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)
> 	at
> com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)
> 	at
> com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)
> 	at
> com.opensymphony.xwork2.interceptor.ChainingInterceptor.intercept(ChainingInterceptor.java:115)
> 	at
> com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)
> 	at
> com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)
> 	at
> com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)
> 	at
> com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)
> 	at
> com.testing.app.common.presentation.interceptor.LocaleInterceptor.intercept(LocaleInterceptor.java:71)
> 	at
> com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)
> 	at
> com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)
> 	at
> com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)
> 	at
> com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)
> 	at
> com.testing.app.common.presentation.interceptor.ReferrerInterceptor.intercept(ReferrerInterceptor.java:94)
> 	at
> com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)
> 	at
> com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)
> 	at
> com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)
> 	at
> com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)
> 	at
> org.apache.struts2.interceptor.ServletConfigInterceptor.intercept(ServletConfigInterceptor.java:170)
> 	at
> com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)
> 	at
> com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)
> 	at
> com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)
> 	at
> com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)
> 	at
> com.testing.app.common.presentation.interceptor.appExceptionInterceptor.intercept(appExceptionInterceptor.java:34)
> 	at
> com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)
> 	at
> com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)
> 	at
> com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)
> 	at
> com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)
> 	at
> org.apache.struts2.impl.StrutsActionProxy.execute(StrutsActionProxy.java:50)
> 	at
> org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:504)
> 	at
> org.apache.struts2.dispatcher.FilterDispatcher.doFilter(FilterDispatcher.java:419)
> 	at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
> 	at
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
> 	at
> org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
> 	at
> org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
> 	at
> org.apache.geronimo.tomcat.valve.DefaultSubjectValve.invoke(DefaultSubjectValve.java:56)
> 	at
> org.apache.geronimo.tomcat.GeronimoStandardContext$SystemMethodValve.invoke(GeronimoStandardContext.java:406)
> 	at
> org.apache.geronimo.tomcat.valve.GeronimoBeforeAfterValve.invoke(GeronimoBeforeAfterValve.java:47)
> 	at
> org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
> 	at
> org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
> 	at
> org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
> 	at
> org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:568)
> 	at
> org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286)
> 	at
> org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:845)
> 	at
> org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
> 	at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
> 	at java.lang.Thread.run(Thread.java:595)
> Caused by: javax.transaction.TransactionRequiredException
> 	at
> org.apache.openejb.core.transaction.TxMandatory.beforeInvoke(TxMandatory.java:56)
> 	at
> org.apache.openejb.core.stateless.StatelessContainer._invoke(StatelessContainer.java:199)
> 	at
> org.apache.openejb.core.stateless.StatelessContainer._invoke(StatelessContainer.java:188)
> 	at
> org.apache.openejb.core.stateless.StatelessContainer.invoke(StatelessContainer.java:165)
> 	at
> org.apache.openejb.core.ivm.EjbObjectProxyHandler.businessMethod(EjbObjectProxyHandler.java:217)
> 	at
> org.apache.openejb.core.ivm.EjbObjectProxyHandler._invoke(EjbObjectProxyHandler.java:77)
> 	at
> org.apache.openejb.core.ivm.BaseEjbProxyHandler.invoke(BaseEjbProxyHandler.java:321)
> 	... 84 more
> 
> 
> If it the ejb is configured with RequiresNew as per J2EE Specs..
> If the client is not associated with a transaction, the container starts a
> new transaction before running the method. 
> 
> So in that case, it is not necessary to send a transaction context from the
> web client (within the same server instance)
> 
> Anybody, working with open in geronimo faced a similar issue?
> 
> Anshuk
> -- 
> View this message in context: http://apache-geronimo.328035.n3.nabble.com/geronimo-2-1-4-container-managed-transaction-tp768780p777883.html
> Sent from the Users mailing list archive at Nabble.com.


Re: geronimo 2.1.4 container managed transaction

Posted by Anshuk <An...@infosys.com>.
Hello All,

I am able to create the database pool using the tranql resource adapter for
oracle local. 

Now if the ejb is configured with the RequiresNew, and the method in the ejb
is being invoked from a web client in the ear as such, I am getting an
error:

javax.ejb.TransactionRequiredLocalException
	at
org.apache.openejb.core.ivm.BaseEjbProxyHandler.convertException(BaseEjbProxyHandler.java:341)
	at
org.apache.openejb.core.ivm.BaseEjbProxyHandler.invoke(BaseEjbProxyHandler.java:323)
	at
org.apache.openejb.util.proxy.Jdk13InvocationHandler.invoke(Jdk13InvocationHandler.java:49)
	at $Proxy47.createUserSession(Unknown Source)
	at
com.testing.app.common.pm.UserClientHelper.createUserSession(UserClientHelper.java:749)
	at
com.testing.app.common.manager.appUserManager.createUserSession(appUserManager.java:465)
	at
com.testing.app.common.presentation.action.LoginAction.Submit(LoginAction.java:341)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:585)
	at
com.opensymphony.xwork2.DefaultActionInvocation.invokeAction(DefaultActionInvocation.java:404)
	at
com.opensymphony.xwork2.DefaultActionInvocation.invokeActionOnly(DefaultActionInvocation.java:267)
	at
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:229)
	at
com.opensymphony.xwork2.interceptor.DefaultWorkflowInterceptor.doIntercept(DefaultWorkflowInterceptor.java:221)
	at
com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:86)
	at
com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)
	at
com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)
	at
com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)
	at
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)
	at
com.opensymphony.xwork2.interceptor.PrepareInterceptor.doIntercept(PrepareInterceptor.java:121)
	at
com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:86)
	at
com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)
	at
com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)
	at
com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)
	at
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)
	at
com.testing.app.common.presentation.interceptor.appManagerInterceptor.intercept(appManagerInterceptor.java:31)
	at
com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)
	at
com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)
	at
com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)
	at
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)
	at
com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:167)
	at
com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:86)
	at
com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)
	at
com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)
	at
com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)
	at
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)
	at
com.opensymphony.xwork2.interceptor.StaticParametersInterceptor.intercept(StaticParametersInterceptor.java:105)
	at
com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)
	at
com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)
	at
com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)
	at
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)
	at
com.opensymphony.xwork2.interceptor.ChainingInterceptor.intercept(ChainingInterceptor.java:115)
	at
com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)
	at
com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)
	at
com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)
	at
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)
	at
com.testing.app.common.presentation.interceptor.LocaleInterceptor.intercept(LocaleInterceptor.java:71)
	at
com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)
	at
com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)
	at
com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)
	at
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)
	at
com.testing.app.common.presentation.interceptor.ReferrerInterceptor.intercept(ReferrerInterceptor.java:94)
	at
com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)
	at
com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)
	at
com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)
	at
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)
	at
org.apache.struts2.interceptor.ServletConfigInterceptor.intercept(ServletConfigInterceptor.java:170)
	at
com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)
	at
com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)
	at
com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)
	at
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)
	at
com.testing.app.common.presentation.interceptor.appExceptionInterceptor.intercept(appExceptionInterceptor.java:34)
	at
com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)
	at
com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)
	at
com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)
	at
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)
	at
org.apache.struts2.impl.StrutsActionProxy.execute(StrutsActionProxy.java:50)
	at
org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:504)
	at
org.apache.struts2.dispatcher.FilterDispatcher.doFilter(FilterDispatcher.java:419)
	at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
	at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
	at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
	at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
	at
org.apache.geronimo.tomcat.valve.DefaultSubjectValve.invoke(DefaultSubjectValve.java:56)
	at
org.apache.geronimo.tomcat.GeronimoStandardContext$SystemMethodValve.invoke(GeronimoStandardContext.java:406)
	at
org.apache.geronimo.tomcat.valve.GeronimoBeforeAfterValve.invoke(GeronimoBeforeAfterValve.java:47)
	at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
	at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
	at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
	at
org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:568)
	at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286)
	at
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:845)
	at
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
	at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
	at java.lang.Thread.run(Thread.java:595)
Caused by: javax.transaction.TransactionRequiredException
	at
org.apache.openejb.core.transaction.TxMandatory.beforeInvoke(TxMandatory.java:56)
	at
org.apache.openejb.core.stateless.StatelessContainer._invoke(StatelessContainer.java:199)
	at
org.apache.openejb.core.stateless.StatelessContainer._invoke(StatelessContainer.java:188)
	at
org.apache.openejb.core.stateless.StatelessContainer.invoke(StatelessContainer.java:165)
	at
org.apache.openejb.core.ivm.EjbObjectProxyHandler.businessMethod(EjbObjectProxyHandler.java:217)
	at
org.apache.openejb.core.ivm.EjbObjectProxyHandler._invoke(EjbObjectProxyHandler.java:77)
	at
org.apache.openejb.core.ivm.BaseEjbProxyHandler.invoke(BaseEjbProxyHandler.java:321)
	... 84 more


If it the ejb is configured with RequiresNew as per J2EE Specs..
If the client is not associated with a transaction, the container starts a
new transaction before running the method. 

So in that case, it is not necessary to send a transaction context from the
web client (within the same server instance)

Anybody, working with open in geronimo faced a similar issue?

Anshuk
-- 
View this message in context: http://apache-geronimo.328035.n3.nabble.com/geronimo-2-1-4-container-managed-transaction-tp768780p777883.html
Sent from the Users mailing list archive at Nabble.com.

Re: geronimo 2.1.4 container managed transaction

Posted by Anshuk <An...@infosys.com>.
Hello David, 

I am now using the the generic adapter, with set the property
CommitOnAutocommit to true. 

Now in the code, nowhere setAutcommit is being called/invoked. 

For a good scenario, the rows are getting inserted and I can check them in
the database as well. Now for the reason which I was doing the test, is to
chck the transaction rollback support using the ejb. 

Scenario 
---------- 
To check for rollback: 

After I insert the record, I am throwing a runtime exception. I am catching
that exception and invking the 

sessionContext.setRollbackOnly(); 

The stateless session is thrwoing while invoking that setRollbackOnly()
method. 

2010-05-03 18:17:13,051 ERROR [TestBean] Could not rollback CMT! 
java.lang.IllegalStateException: bean-managed transaction beans can not
access the setRollbackOnly() method 
        at
org.apache.openejb.core.BaseContext$State.setRollbackOnly(BaseContext.java:266) 
        at
org.apache.openejb.core.BaseContext.setRollbackOnly(BaseContext.java:110) 
        at com.testingejb.manager.ejb.TestBean.rollback(TestBean.java:1178) 
        at
com.testingejb.manager.ejb.TestBean.createPOCProfile(TestBean.java:1528) 
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 
        at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) 
        at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) 
        at java.lang.reflect.Method.invoke(Method.java:585) 
        at
org.apache.openejb.core.interceptor.ReflectionInvocationContext$Invocation.invoke(ReflectionInvocationContext.java:158) 
        at
org.apache.openejb.core.interceptor.ReflectionInvocationContext.proceed(ReflectionInvocationContext.java:141) 
        at
org.apache.openejb.core.interceptor.InterceptorStack.invoke(InterceptorStack.java:67) 
        at
org.apache.openejb.core.stateless.StatelessContainer._invoke(StatelessContainer.java:210) 
        at
org.apache.openejb.core.stateless.StatelessContainer._invoke(StatelessContainer.java:188) 
        at
org.apache.openejb.core.stateless.StatelessContainer.invoke(StatelessContainer.java:165) 
        at
org.apache.openejb.core.ivm.EjbObjectProxyHandler.businessMethod(EjbObjectProxyHandler.java:217) 
        at
org.apache.openejb.core.ivm.EjbObjectProxyHandler._invoke(EjbObjectProxyHandler.java:77) 
        at
org.apache.openejb.core.ivm.BaseEjbProxyHandler.invoke(BaseEjbProxyHandler.java:321) 
        at
org.apache.openejb.util.proxy.Jdk13InvocationHandler.invoke(Jdk13InvocationHandler.java:49) 
        at $Proxy47.createPOCProfile(Unknown Source) 
        at
com.testingejb.common.PMClientHelper.createPOCProfile(PMClientHelper.java:2197) 
        at
com.testingejb.common.manager.ProfileManager.create(ProfileManager.java:557) 
        at
com.testingejb.common.presentation.action.POCProfileHandlerAction.Submit(POCProfileHandlerAction.java:440) 
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 
        at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) 
        at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) 
        at java.lang.reflect.Method.invoke(Method.java:585) 
        at
com.opensymphony.xwork2.DefaultActionInvocation.invokeAction(DefaultActionInvocation.java:404) 
        at
com.opensymphony.xwork2.DefaultActionInvocation.invokeActionOnly(DefaultActionInvocation.java:267) 
        at
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:229) 
        at
com.opensymphony.xwork2.interceptor.DefaultWorkflowInterceptor.doIntercept(DefaultWorkflowInterceptor.java:221) 
        at
com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:86) 
        at
com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224) 
        at
com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223) 
        at
com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455) 
        at
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221) 
        at
com.opensymphony.xwork2.interceptor.PrepareInterceptor.doIntercept(PrepareInterceptor.java:121) 
        at
com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:86) 
        at
com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224) 
        at
com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223) 
        at
com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455) 
        at
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221) 
        at ... 


I did try the bean to be container or bean, it is the same error. I tried
the trans attribute for Required or RequiresNew, same thing. 

This illegal state exception, is thrown from the open ejb (class:
CoreContext ), correct me if I am wrong. 

Any workaround?? 

Does Geronimo 2.1.4 really support container managed transaction? 

Anshuk 
-- 
View this message in context: http://apache-geronimo.328035.n3.nabble.com/geronimo-2-1-4-container-managed-transaction-tp768780p775052.html
Sent from the Users mailing list archive at Nabble.com.

Re: geronimo 2.1.4 container managed transaction

Posted by Anshuk <An...@infosys.com>.
Hello David, 

I am now using the the generic adapter, with set the property
CommitOnAutocommit to true. 

Now in the code, nowhere setAutcommit is being called/invoked.

For a good scenario, the rows are getting inserted and I can check them in
the database as well. Now for the reason which I was doing the test, is to
chck the transaction rollback support using the ejb.

Scenario
----------
To check for rollback:

After I insert the record, I am throwing a runtime exception. I am catching
that exception and invking the 

sessionContext.setRollbackOnly();

The stateless session is thrwoing while invoking that setRollbackOnly()
method.

2010-05-03 18:17:13,051 ERROR [TestBean] Could not rollback CMT!
java.lang.IllegalStateException: bean-managed transaction beans can not
access the setRollbackOnly() method
	at
org.apache.openejb.core.BaseContext$State.setRollbackOnly(BaseContext.java:266)
	at
org.apache.openejb.core.BaseContext.setRollbackOnly(BaseContext.java:110)
	at com.testingejb.manager.ejb.TestBean.rollback(TestBean.java:1178)
	at com.testingejb.manager.ejb.TestBean.createPOCProfile(TestBean.java:1528)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:585)
	at
org.apache.openejb.core.interceptor.ReflectionInvocationContext$Invocation.invoke(ReflectionInvocationContext.java:158)
	at
org.apache.openejb.core.interceptor.ReflectionInvocationContext.proceed(ReflectionInvocationContext.java:141)
	at
org.apache.openejb.core.interceptor.InterceptorStack.invoke(InterceptorStack.java:67)
	at
org.apache.openejb.core.stateless.StatelessContainer._invoke(StatelessContainer.java:210)
	at
org.apache.openejb.core.stateless.StatelessContainer._invoke(StatelessContainer.java:188)
	at
org.apache.openejb.core.stateless.StatelessContainer.invoke(StatelessContainer.java:165)
	at
org.apache.openejb.core.ivm.EjbObjectProxyHandler.businessMethod(EjbObjectProxyHandler.java:217)
	at
org.apache.openejb.core.ivm.EjbObjectProxyHandler._invoke(EjbObjectProxyHandler.java:77)
	at
org.apache.openejb.core.ivm.BaseEjbProxyHandler.invoke(BaseEjbProxyHandler.java:321)
	at
org.apache.openejb.util.proxy.Jdk13InvocationHandler.invoke(Jdk13InvocationHandler.java:49)
	at $Proxy47.createPOCProfile(Unknown Source)
	at
com.testingejb.common.PMClientHelper.createPOCProfile(PMClientHelper.java:2197)
	at
com.testingejb.common.manager.ProfileManager.create(ProfileManager.java:557)
	at
com.testingejb.common.presentation.action.POCProfileHandlerAction.Submit(POCProfileHandlerAction.java:440)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:585)
	at
com.opensymphony.xwork2.DefaultActionInvocation.invokeAction(DefaultActionInvocation.java:404)
	at
com.opensymphony.xwork2.DefaultActionInvocation.invokeActionOnly(DefaultActionInvocation.java:267)
	at
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:229)
	at
com.opensymphony.xwork2.interceptor.DefaultWorkflowInterceptor.doIntercept(DefaultWorkflowInterceptor.java:221)
	at
com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:86)
	at
com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)
	at
com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)
	at
com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)
	at
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)
	at
com.opensymphony.xwork2.interceptor.PrepareInterceptor.doIntercept(PrepareInterceptor.java:121)
	at
com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:86)
	at
com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)
	at
com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)
	at
com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)
	at
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)
	at ...


I did try the bean to be container or bean, it is the same error. I tried
the trans attribute for Required or RequiresNew, same thing.

This illegal state exception, is thrown from the open ejb (class:
CoreContext ), correct me if I am wrong.

Any workaround??

Does Geronimo 2.1.4 really support container managed transaction?

Anshuk
-- 
View this message in context: http://apache-geronimo.328035.n3.nabble.com/geronimo-2-1-4-container-managed-transaction-tp768780p774568.html
Sent from the Users mailing list archive at Nabble.com.