1 Reply Latest reply on Oct 17, 2003 2:48 AM by bosky

    Beans and DB Connection

    deepak.j

      Hi;

      I've deployed an MDB in JBoss 3.2.0. The MDB accesses an MS SQL 2000 DB through the JDBC APIs. I have a manual commit transaction block that involves multiple Inserts and Updates. One of the steps is to get back a generated key (IDENTITY) which I presume can be done using @@IDENTITY.
      My Question is:
      1) What happens to the connection if the bean is swapped out when the transaction has not yet been completed? Will a connection that is associated with un-commited data be given to another bean? Will the swapped out bean instance get back the same connection?

      If any of have encountered a similar situation, please help!




        • 1. Re: Beans and DB Connection
          bosky

          Let me reply to your Q one by one:

          Q
          1) What happens to the connection if the bean is swapped out when the transaction has not yet been completed? Will a connection that is associated with un-commited data be given to another bean? Will the swapped out bean instance get back the same connection?

          Answer: VERY EASY ISSUE/PROBLEM!!

          1.The Bean gets emotionally unstable!
          2.You can do the cross connection with an un commited data given by another bean but its like ditching the other bean. which is Terrible.
          3. Insome instances we have seen the bean and the swapped beans become friends in the end and wachMr. Beans so the connection can be restored.

          WHEW! i think i answed enough and i am on the wrong web site..ask someone else for help..HUH!!