I fail setting the transaction timeout in Weblogic 8.1sp5

Posted on 2006-05-22
Last Modified: 2013-12-10
In my case, I try to use one XA transaction to coordinate multiple databases operation, so I setup multiple XA-style DBPool according to the multiple databases. I set the "Enable XA Transaction Timeout=true" & "XA Transaction Timeout=300" in every XA-style DBPool via Weglogic admin console. But after I restart the server and test my code with it. This exception "Transaction timed out after 31 seconds" thrown by weblogic. Could you advise me how to set the transaction timeout correctly?
Question by:baabul
    LVL 10

    Expert Comment


    are you using ejbs ?
    Do you managed transaction inside your code, or do you left the container to deal with ?


    Author Comment


    No ejb's in my case. I use the Hibernate(3.1.3) as the data access tier. Actually I create multiple XA-style datasources in weblogic for my different databases, then config these datasources in Hibernate for creating multiple SessionFactories (one factory for one database). Then implement a JTA interceptor for handling the transaction. When a jta method is invoked, my interceptor will capture it and inject jta transaction code before and after its invoking. The pseudocode has been appended in the end for your reference. The UserTransaction got from weblogic will control the whole transaction processing, so I config its timeout in weblogic will affect on my code. But it's not, the exception "Transaction timed out after 31 seconds" is still thrown by weblogic. I don't know how I can handle it, please advise.


    *****my code************
    UserTransaction tx = null;
    try {                        
          Context ctx = JndiHelper.instance().getContext();
          String jtstransaction = "javax.transaction.UserTransaction";
                jtstransaction = JndiHelper.instance().getJndiParam("jta.UserTransaction");
          tx = (UserTransaction)ctx.lookup(jtstransaction);
          Object retObject = method.invoke(target, args);
          return retObject;
    }catch(Exception e){
        throw new Exception(e.getCause());

    Author Comment


    I have finished my case, just set the UserTransaction.setTimeout to the seconds I expect.

    LVL 1

    Accepted Solution

    PAQed with points refunded (20)

    Community Support Moderator

    Featured Post

    Highfive Gives IT Their Time Back

    Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

    Join & Write a Comment

    Suggested Solutions

    -Xmx and -Xms are the two JVM options often used to tune JVM heap size.   Here are some common mistakes made when using them:   Assume BigApp is a java class file for the below examples. 1.         Missing m, M, g or G at the end …
    This exercise is about for the following scenario: Dmgr and One node with 2 application server. Each application server contains it owns application. Application server name as follows server1 contains app1 server2 contains app1 Prereq…
    This video discusses moving either the default database or any database to a new volume.
    Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

    755 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    21 Experts available now in Live!

    Get 1:1 Help Now