3 Replies Latest reply on Jun 20, 2011 7:20 AM by welle

    how to set Transaction attribute notsupported to MBean

    mayankmit2002

      I've created  a MBean. Now what I want is how to specify the transaction attribute 'notsupported' in deployment descriptor.

       

      I triesd following code but is not working

      <server>
      <mbean code="test.TestBean"
            name="test:service=TestBean">
            <depends>
               <mbean code="org.jboss.invocation.jrmp.server.JRMPProxyFactory"
                  name="jboss:service=proxyFactory,target=TestBean">
                  <attribute name="InvokerName">jboss:service=invoker,type=unified</attribute>
                  <attribute name="TargetName">test:service=TestBean</attribute>
                  <attribute name="JndiName">ITestBean</attribute>
                  <attribute name="ExportedInterface">test.ITestBean</attribute>
                  <attribute name="ClientInterceptors">
                     <interceptors>
                        <interceptor>org.jboss.proxy.ClientMethodInterceptor</interceptor>
                        <interceptor>org.jboss.invocation.InvokerInterceptor</interceptor>
                     </interceptors>
                  </attribute>
                  <depends>jboss:service=invoker,type=unified</depends>
               </mbean>
            </depends>     
            <transaction-type>Container</transaction-type>
            <container-transaction>
              <method>
                  <ejb-name>TestBean</ejb-name>
                  <method-name>*</method-name>
              </method>
              <trans-attribute>NotSupported </trans-attribute>
            </container-transaction>
         </mbean>
         </server>
      

       

      The same is possible in EJB3 is with using @TransactionAttribute, but the problem is EJB3 is that I no where find any sample.

      What I found is https://issues.jboss.org/browse/EJBTHREE-743.

       

      now how to proceede..

       

      JBoss AS 4.2.3 GA

        • 1. Re: how to set Transaction attribute notsupported to MBean
          welle

          You cannot apply the J2EE/JEE  transaction  model on pure JMX beans. You have to handle the transaction code yourself (Or call a SLSB from the MBean perhaps that does it for you).

           

          When using EJB3 you may use the JBoss extension for creating MBeans with annotations. In that case __PERHAPS__ EJB3 annotated transaction model works (I think so but haven't tested it myself)

          • 2. Re: how to set Transaction attribute notsupported to MBean
            mayankmit2002

            Thanks Anders.

            Yeah, with EJB3 transaction demarcation is possible with Service POJO. But I've to use MBean as providing attributes to depending MBean is not possible there.

               Actually I want to use both JRMP and transaction demarcation. Service POJO's provide transaction demarcation, but is not providing luxury to provide attributes to depending bean, with traditional MBean the case is vice-versa.

            • 3. Re: how to set Transaction attribute notsupported to MBean
              welle

              A simple solution is perhaps to impl. the absolute-non-transactional code in a "NonSupported" EJB3 SLSB and let the MBean call it.

              1 of 1 people found this helpful