[Design of Messaging on JBoss (Messaging/JBoss)] - Can the transaction manager retry commit or rollback?
by timfox
Just wanted to clarify something w.r.t transactions in JBM.
On the messsaging server we maintain state corresponding to transactions in the prepared state in a map in memory.
If commit or rollback is invoked on an xaresource we look up the corresponding transactional state in the map and commit/roll-it-back.
My question is this: If commit or rollback throws an exception is it valid for the transaction manager to retry the commit or rollback (without first calling recover)?
If I can assume the commit/rollback is never retried then I can safely remove the transaction state from the map in a finally block, whether or not the commit or rollback succeeded.
If not, then I cannot see a safe time when the transaction state can be removed from the map.
I cannot just remove it when the commit/rollback processing seems to complete without throwing an exception, since the network might fail before the invocation has returned to the client, so the client may still receive an exception.
Not removing the state will give us a memory leak.
My assumption is therefore that commit/rollback can never be retried (what about prepare?) - is this correct?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3972155#3972155
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3972155
19 years, 6 months
[Design of JBoss Portal] - HelloWorldJSFPortlet
by alain_fr
I'm trying to use HelloWorldJSFPortlet
from PortletSwap.com but i have an error
java.lang.NullPointerException
| org.jboss.portal.theme.impl.strategy.MaximizingStrategyImpl.stateChanged(MaximizingStrategyImpl.java:104)
| org.jboss.portal.core.aspects.controller.PageNavigationInterceptor.updatePageNavigationalState(PageNavigationInterceptor.java:109)
| org.jboss.portal.core.command.InvokeWindowRenderCommand.execute(InvokeWindowRenderCommand.java:106)
| org.jboss.portal.core.command.ControllerCommand.dispatch(ControllerCommand.java:91)
| org.jboss.portal.common.invocation.Invocation.invokeNext(Invocation.java:140)
| org.jboss.portal.core.aspects.controller.EventBroadcasterInterceptor.invoke(EventBroadcasterInterceptor.java:171)
| org.jboss.portal.core.command.CommandInterceptor.invoke(CommandInterceptor.java:37)
| org.jboss.portal.common.invocation.Invocation.invokeNext(Invocation.java:130)
| org.jboss.portal.core.aspects.controller.PageNavigationInterceptor.invoke(PageNavigationInterceptor.java:80)
| org.jboss.portal.core.command.CommandInterceptor.invoke(CommandInterceptor.java:37)
| org.jboss.portal.common.invocation.Invocation.invokeNext(Invocation.java:130)
| org.jboss.portal.core.aspects.controller.PolicyEnforcementInterceptor.invoke(PolicyEnforcementInterceptor.java:79)
| org.jboss.portal.core.command.CommandInterceptor.invoke(CommandInterceptor.java:37)
| org.jboss.portal.common.invocation.Invocation.invokeNext(Invocation.java:130)
| org.jboss.portal.core.aspects.controller.PortalNodeInterceptor.invoke(PortalNodeInterceptor.java:59)
| org.jboss.portal.core.command.CommandInterceptor.invoke(CommandInterceptor.java:37)
| org.jboss.portal.common.invocation.Invocation.invokeNext(Invocation.java:130)
| org.jboss.portal.common.invocation.Invocation.invoke(Invocation.java:171)
| org.jboss.portal.core.command.CommandContext.execute(CommandContext.java:102)
| org.jboss.portal.core.command.ExecutionContext.execute(ExecutionContext.java:91)
| org.jboss.portal.core.command.ExecutionContext.execute(ExecutionContext.java:78)
| org.jboss.portal.core.CoreController.handle(CoreController.java:126)
| sun.reflect.GeneratedMethodAccessor360.invoke(Unknown Source)
| sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
| java.lang.reflect.Method.invoke(Method.java:585)
| org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
| org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
| org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:133)
| org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
| org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:142)
| org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
| org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
| org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
| org.jboss.mx.util.JMXInvocationHandler.invoke(JMXInvocationHandler.java:287)
| $Proxy139.handle(Unknown Source)
| org.jboss.portal.server.ServerInvocation.dispatch(ServerInvocation.java:79)
| org.jboss.portal.common.invocation.Invocation.invokeNext(Invocation.java:140)
| org.jboss.portal.server.aspects.server.NavigationInterceptor.invoke(NavigationInterceptor.java:64)
| org.jboss.portal.server.ServerInterceptor.invoke(ServerInterceptor.java:37)
| org.jboss.portal.common.invocation.Invocation.invokeNext(Invocation.java:130)
| org.jboss.portal.server.aspects.server.ContentTypeInterceptor.invoke(ContentTypeInterceptor.java:65)
| org.jboss.portal.server.ServerInterceptor.invoke(ServerInterceptor.java:37)
| org.jboss.portal.common.invocation.Invocation.invokeNext(Invocation.java:130)
| org.jboss.portal.core.aspects.server.LocaleInterceptor.invoke(LocaleInterceptor.java:74)
| org.jboss.portal.server.ServerInterceptor.invoke(ServerInterceptor.java:37)
| org.jboss.portal.common.invocation.Invocation.invokeNext(Invocation.java:130)
| org.jboss.portal.core.aspects.server.UserInterceptor.invoke(UserInterceptor.java:174)
| org.jboss.portal.server.ServerInterceptor.invoke(ServerInterceptor.java:37)
| org.jboss.portal.common.invocation.Invocation.invokeNext(Invocation.java:130)
| org.jboss.portal.server.aspects.server.SessionInvalidatorInterceptor.invoke(SessionInvalidatorInterceptor.java:92)
| org.jboss.portal.server.ServerInterceptor.invoke(ServerInterceptor.java:37)
| org.jboss.portal.common.invocation.Invocation.invokeNext(Invocation.java:130)
| org.jboss.portal.core.aspects.server.TransactionInterceptor.org$jboss$portal$core$aspects$server$TransactionInterceptor$invoke$aop(TransactionInterceptor.java:49)
| org.jboss.portal.core.aspects.server.TransactionInterceptor$invoke_N5143606530999904530.invokeNext(TransactionInterceptor$invoke_N5143606530999904530.java)
| org.jboss.aspects.tx.TxPolicy.invokeInOurTx(TxPolicy.java:79)
| org.jboss.aspects.tx.TxInterceptor$RequiresNew.invoke(TxInterceptor.java:275)
| org.jboss.portal.core.aspects.server.TransactionInterceptor$invoke_N5143606530999904530.invokeNext(TransactionInterceptor$invoke_N5143606530999904530.java)
| org.jboss.portal.core.aspects.server.TransactionInterceptor.invoke(TransactionInterceptor.java)
| org.jboss.portal.server.ServerInterceptor.invoke(ServerInterceptor.java:37)
| org.jboss.portal.common.invocation.Invocation.invokeNext(Invocation.java:130)
| org.jboss.portal.common.invocation.Invocation.invoke(Invocation.java:171)
| org.jboss.portal.server.servlet.PortalServlet.process(PortalServlet.java:294)
| org.jboss.portal.server.servlet.PortalServlet.doGet(PortalServlet.java:172)
| javax.servlet.http.HttpServlet.service(HttpServlet.java:697)
| javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
| org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
anyone can help me?
thank you
Alain
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3972150#3972150
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3972150
19 years, 6 months
[Design of JBoss Serialization] - Re: Interceptor medasata issue
by tterm
Hello Clebert,
so now let's come to the details and sorry for the long response time. I have a lot to do at the moment.
The interceptors are requested during an ejb3 method call. The client side interceptor code is the following:
| public class ExampleClientInterceptor implements Interceptor, Serializable {
| private static Logger logger = Logger.getLogger(ExampleClientInterceptor.class);
|
| public String getName() {
| return "ExampleClientInterceptor";
| }
|
| public Object invoke(Invocation invocation) throws Throwable {
| logger.debug("Client: request");
| SimpleMetaData metaData = invocation.getMetaData();
| metaData.addMetaData("tag", "attr", "Hello JBoss;-)");
| Object obj = invocation.invokeNext();
| logger.debug("Client: response");
| return obj;
| }
| }
You can see I just add a simple string to the metadata which should be read later from the server side interceptor. The server side interceptor has the following code:
public class ExampleServerInterceptor implements Interceptor{
| private static Logger logger = Logger.getLogger(ExampleServerInterceptor.class);
|
| public String getName(){
| return "ExampleServerInterceptor";
| }
|
| public Object invoke(Invocation invocation) throws Throwable{
| logger.debug("Server: request");
| SimpleMetaData metaData = invocation.getMetaData();
| String str = (String)metaData.getMetaData("tag", "attr");
| logger.debug("Output from metaData: " + str);
| Object obj = invocation.invokeNext();
| logger.debug("Server: response");
| return obj;
| }
| }
The interceptors are both registerded in the ejb3-interceptors-aop.xml which looks like the following:
| <aop>
| <interceptor class="de.example.ExampleClientInterceptor" scope="PER_VM"/>
| <interceptor class="de.example.ExampleServerInterceptor" scope="PER_VM"/>
|
| ....
|
| <stack name="StatelessSessionClientInterceptors">
| <interceptor-ref name="de.example.ExampleClientInterceptor"/>
| ...
| </stack>
| ... the same for the other client side stacks like stateful and so on
|
| server side stuff
|
| <domain name="Stateless Bean">
| <bind pointcut="execution(public * *->*(..))">
| <interceptor-ref name="de.example.ExampleServerInterceptor"/>
| ...
| </domain>
|
| ... the same for the other session bean stuff
|
| </aop>
|
So if you invoke an ejb3 method then you get allways the exception I described before and you will never come to the server side interceptor. I don't know if I do something wrong here but as I said before it works fine until JBoss4.0.3SP1.
It would be very nice if we could sorting out this things because I need it to finish an performance instrumentation project.
You can download the test project described before from http://www.strace.org/~tterm/jboss-testcase.zip (You can contact me private if you use this domain and put the username before the @ sign). If you need an ejb project for testing this things I can give you also an test project. Just let me know.
Thanks in advance.
Thomas Termin
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3972138#3972138
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3972138
19 years, 6 months