Error while invoking Rollback method

Discussions

EJB programming & troubleshooting: Error while invoking Rollback method

  1. Error while invoking Rollback method (2 messages)

    Hai,

    Am using weblogic 5.1.Database sybase sql server.
    Trying for BMT(Bean Managed Transaction)
    stateless session bean

    I got a UserTransaction like this(Am i right)
    try{
    tx=(UserTransaction)ic.lookup("javax.transaction.UserTransaction");
     a.method1();//which do some database operation
     b.method2();//which do some database operation
    tx.commit();
    }
    catch(Exception e){
     try{
        tx.rollback();
     }
     catch(Exception ex){
       System.out.println("Exception in rollback"+ex);
     }
     System.out.println("Exception in lookup"+e);
    }

    a.method1()---> succedds in database operation
    b.method2()---->throws Exception inorder to rollback

    Even though I throw exception in b.method2(),a.method1()
    is not rollbacking

    Am getting exception like this:

    Exception in rollbackjava.lang.IllegalStateException: There is no transaction associated with this thread
    Exception in lookup javax.transaction. TransactionRolledbackException:
    Transaction: '963124471576_1' rolled back due to EJB exception:
    javax.ejb.EJBException
            at com.bank.bciticorp.BCitiBankBean.deposit(Compiled Code)
            at com.bank.bciticorp.BCitiBankBeanEOImpl.deposit(BCitiBankBeanEOImpl.ja
    va:56)
            at com.bank.bglobal.BGlobalBean.transferSTtoCT(BGlobalBean.java:55)
            at com.bank.bglobal.BGlobalBeanEOImpl.transferSTtoCT(BGlobalBeanEOImpl.j
    ava:56)
            at com.bank.bglobal.BGlobalBeanEOImpl_WLSkel.invoke(BGlobalBeanEOImpl_WL

    Anyone help in this regard.
    Thanks in advance.
    Regards,
    Vinoth.C
  2. I missed one line in the previous posting
    try{
    tx=(UserTransaction)ic.lookup("javax.transaction.UserTransaction");
     tx.begin(); <--------

    Regards,
    Vinoth.C
  3. Error while invoking Rollback method[ Go to top ]

    I have been following several threads you started with great interests and threw in my $0.02 here and there. If you don't mind, can you send me (eric dot ma at home dot com) a scaled-down version of your beans, deployment descriptors, the weblogic.propertes file, and database schema so I can try them out on Oracle with different JDBC drivers? I don't know how many people in this forum have experience with the kind of TX you wanted to do, and the best way to get an answer is to try with as many RDBMS as possible.