TX-Supports attribute


EJB programming & troubleshooting: TX-Supports attribute

  1. TX-Supports attribute (4 messages)

    Hi all,
    I'd like to know what kind of performance benefit I can get using the TX-Supports Attribute instead of the TX-Required.

    Threaded Messages (4)

  2. TX-Supports attribute[ Go to top ]

    We can compare TX_Required and TX_Supports in Non Mission Critical Environment only.Becouse in Mission Critical Environment we should use TX_Required.Because the Transaction is must there.

    In Non Mission Critical Environment,

               if there is already some Transaction Running, then there is no difference for TX_Required and TX_Supports in Performancewise.
               if there is no Transaction Running Currently , then the bean with TX_Support gives better Performance than the Bean with TX_Required Attribute.
               Becouse bean with TX_Required Attribute , will create a New Transaction when there is no Transaction.so it will take some amount of resources and time to get new Transaction and reduces the Performance.
               But Bean with TX_Supports won't create any new Transactions when there is no Transaction.so it will give Better Performance than the Bean with TX_Required Attribute.
  3. TX-Supports attribute[ Go to top ]

    just a last questions: is there too a difference concerning call-back methods? that is, beans deployed with Tx-Supports issue less callback methods then those with Tx-Required ?
  4. TX-Supports attribute[ Go to top ]


       There is no Difference in calling CallBack Methods .

  5. TX-Supports attribute[ Go to top ]

    Hi there. Just some additions to sarvana's notes:
    1. TX_SUPPORTED may be apropriate in mission-critical apps. It all depends on what the method does and how it does it. For instance, methods which only read data from the DB and do so with a single statement may not need a transaction due to the atomicity of statements supported on most RDBMSs.
    2. TX_SUPPORTED may improve the performance a little even when called within a transaction.

    A seperate issue you need to know about is that methods that use TX_SUPPORTED in entity beans should not rely on their cached state. The container has no way of properly synchronizing the cached state with the DB without imposing performance issues.