geronimo-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Anshuk <Anshuk_Chaudh...@infosys.com>
Subject Re: geronimo 2.1.4 container managed transaction
Date Mon, 03 May 2010 22:48:07 GMT

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.

Mime
View raw message