1 Reply Latest reply on Jul 10, 2002 8:24 PM by Dain Sundstrom

    Vendor Neutral Transactions/Rollback?

    Siegfried Heintze Newbie

      Apparently J2EE does not define the concept of a database transacation and rollback which seems strange (since I come from the Microsoft world).

      How do folks implement a vendor neutral transaction in JBOSS?

      If you are using a SQL insert statement into a table that has an auto-increment field for the primary key, how does one write vendor neutral code to retrieve the newly created key?

      It seems that J2EE should solve this problems. If not, does JBOSS?

      Thanks,
      Siegfried

        • 1. Re: Vendor Neutral Transactions/Rollback?
          Dain Sundstrom Master

          > Apparently J2EE does not define the concept of a
          > database transacation and rollback which seems
          > strange (since I come from the Microsoft world).

          It is easy in the MS world because they are the only important vendor.

          > How do folks implement a vendor neutral transaction
          > in JBOSS?

          The EJB spec has a huge section on transactions. What do you want to do with the transaction? The easiest thing to do is mark a mathod as requireing a transaction in the ejb-jar.xml deployment descriptor file. This causes the container to requrire a transaction be started before the method is called (it will start one if one is not started).

          > If you are using a SQL insert statement into a table
          > that has an auto-increment field for the primary key,
          > how does one write vendor neutral code to retrieve
          > the newly created key?

          Take a look at the JDBC 3.0 specification. JDBC 3.0 is included in JDK 1.4.

          > It seems that J2EE should solve this problems. If
          > not, does JBOSS?

          What problem?