3 Replies Latest reply on Feb 13, 2004 10:59 PM by juha

    does any transaction attribute works in jboss 3.2.1????

    saroramki

      The question is with the A of ACID.. Automicity... on a nutshell the problem is database updated partially- couldn't complete full operation - so supposed to rollback the first either thru JDBC way or thru jboss txn way , but in both ways couldn't rollback the first update...


      This is my environment Jboss3.2.1, Oracle 9i, windows NT(for development env. only)

      SSB(CM) -> DB

      I've a stateful session bean(container managed) as the DAO talking to data base directly using JDBC.
      Data source transaction parameter been set to local-transaction.

      one particular method of this SSB makes 2 db calls. one succeeds, one fails...first update exists in db!!!! I've tried with all 6 different tx attributes out of curiosity.. nothin' works.... Atleast the JDBC way should work when I catch the SQL exception for the second db call and try to rollback the connection, but it doesn't let me.. (connection couldn't rollback kinda error) any clues?

      If I set the data source txn parameter to no-transaction and I set the auto commit to false and make db call , upon succed either commit or rollback - that kinda way works fine... But i don't want to go this way... want to have local-transaction in the data source attribute and want to control the transaction using the txn attributes... haven't tried the last data source txn parameter... (some xa-bla one)

      Am i missing anything ?

      thanks in advance

      saro









        • 1. Re: does any transaction attribute works in jboss 3.2.1????

          Where in your code do you call setRollbackOnly() ?

          • 2. Re: does any transaction attribute works in jboss 3.2.1????
            saroramki

            thanks Juha for your reply
            I don't call setRollbackOnly() anywhere. wondering why should I need to explicitly do this way when I rely on container to handle the transaction. I specify my transaction parameter and I expect container to fulfill
            as per EJB Spec, if there is any prob with the transaction I expect the container to roll back the txn right?

            In my initial mail i've even included the jdbc way of handling and facing failure at that place.. let us leave that part and assume I do only in the EJB way.. i.e declarative transaction way.. I declare what kinda txn I need and I expect the container to handle the txn. I'm now wondering do i've to call setRollbackOnly() in this case

            thanks in advance
            saro

            • 3. Re: does any transaction attribute works in jboss 3.2.1????

              The container can automatically rollback only in case of a runtime exception (as per the spec). With a checked exception you must explicitly tell the container that you want the transaction to be rolled back.