Announcement Announcement Module
No announcement yet.
WLS instrumented transactions, transactions by name Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • WLS instrumented transactions, transactions by name


    We are currently making Spring use

    org.springframework.transaction.jta.JtaTransaction Manager

    as transaction manager.

    This works nice, we see indeed that WebLogic's transaction counters are incremented if Spring handles transactions.

    Only, for problem analysis we are used to take a look at WebLogic's 'Transactions by name' monitoring page. This page lists transaction statistics organized by by EJB and EJB-method. This overview typically gives us an immediate hint about where things get slow or go wrong.

    The JTA transactions initiated by Spring using Weblogic's JTA transaction manager however do not appear in this overview, probably because they are not instrumented with necessary meta-info.

    Is their a way to have Spring initiated WLS JTA transactions appear in this 'Transaction by name' overview?

    Thanks in advance for any tips.


  • #2
    I see... WebLogic seems to apply some special registering of EJB CMT transactions with its transaction monitor. Spring effectively uses WebLogic's JTA subsystem directly, through the standard JTA UserTransaction and TransactionManager interfaces, so won't apply such special registering of transaction names.

    The corresponding facility seems to be the "setName" method on weblogic.transaction.Transaction, according to the docs at I assume that the name specified there will be shown in WebLogic's transaction monitor.

    So essentially, all we need to is provide a special subclass of JtaTransactionManager that calls this WebLogic-specific "setName" method after starting a transaction. We already have a WebLogicJtaTransactionManager class, which would be an obvious place to add such support.

    The remaining question is: Which name do we set for each transaction? I'm inclined to add a "getName" method to the TransactionDefinition interface, passing in this name to the transaction manager. TransactionInterceptor can then pass in the class and method name, while direct TransactionTemplate/PlatformTransactionManager users can pass in a custom name for each transaction.



    • #3

      Would you consider this to be added to Spring in an upcoming release?



      • #4

        I'm happy to announce that all works well - even better than expected :-)

        Spring's WebLogicJtaTransactionManager supports transaction names through WebLogic's UserTransaction.begin(name) method now, which works nicely: Spring-managed transactions show up in WebLogic's transaction monitor.

        Beyond that, I've even been able to figure how per-transaction isolation levels work on WebLogic - an old to-do on our list! This is hidden in the EJB BMT section of the documentation; it's not part of the WebLogic JTA documentation (neither reference nor javadoc).

        Essentially, a special WebLogic transaction property with the magic key "ISOLATION LEVEL" has to be set, then WebLogic will apply that isolation level to all JDBC connections that participate in the given transaction. This is exactly equivalent to the isolation level setting in WebLogic's EJB CMT descriptor.

        This means that our WebLogicJtaTransactionManager supports the full power of Spring's transaction definitions on WebLogic's transaction coordinator, beyond standard JTA: transaction names, per-transaction isolation levels, and proper resuming of transactions in all cases.

        Note that all of this works with public WebLogic API that's available in both WebLogic 7.0 and 8.1. Even if the API details are a bit hidden in the documentation, we're not accessing some not-supported internal mechanisms here, which is certainly a good thing.

        This will be part of Spring 1.2 RC1, scheduled for the end of this week. It should already be available in the latest nightly snapshot!

        I've currently just tested this on WebLogic 8.1 SP4; I hope that there is enough time for tests on WebLogic 7.0 and 9.0 beta before the release.



        • #5
          The most ideal solution.

          Very much appreciated.

          Many thanks, Bart