3 Replies Latest reply on Jan 21, 2003 2:51 AM by Bernd Zeitler

    Commit problem in session bean using CMT

    Ramesh Newbie

      I am using a session bean to insert data into oracle database. The insert works fine from the bean. No errors/exceptions are thrown. But when I try to view the data from oracle's sqlplus, the data does not show up there. As soon as I stop the jboss-server, the data shows up on sql-plus. Looks like the transaction manager is not committing the inserts. Any idea what I may be doing wrong. I have given below the system info. Any help is greatly appreciated.

      System Info:
      1. Using Oracle XA Connection
      2. Using Container Managed Transaction
      3. Jboss Version 3.0.4
      4. JDK 1.3
      5. Oracle 8.1

        • 1. Re: Commit problem in session bean using CMT
          Bernd Zeitler Expert

          some code would be nice:
          - how do you obtain the DB connection?
          - ejb-jar.xml and perhaps jboss.xml

          If you really want to use oracle XA with JBoss, you have to use at least JBoss 3.2 .


          • 2. Re: Commit problem in session bean using CMT
            Ramesh Newbie

            Hi Frito,
            Thanks for getting back to me. The XA Connection is obtained by using JNDI lookup on a data source. Then insert is done using JDBC calls.

            Here is the code to get connection object:

            InitialContext ic = new InitialContext();
            DataSource ds = (DataSource)ic.lookup(jndiName);
            con = ds.getConnection();

            I have also pasted below, portions of oracle-xa-service.xml file.

            <depends optional-attribute-name="OldRarDeployment">jboss.jca:service=RA
            RDeployment,name=Minerva JDBC XATransaction ResourceAdapter
            <!--real attributes-->

            <config-property name="XADataSourceProperties"
            <config-property name="XADataSourceClass"
            <!--set these only if you want only default logins, not through JAAS
            <config-property name="UserName"
            <config-property name="Password"
            Do not try to set transaction isolation level here or you'll get
            java.sql.SQLException: ORA-01453: SET TRANSACTION must be first s
            tatement of transaction
            Read committed is a default isolation level for Oracle, so there
            is not real need to set it here. I'll take a look into it later .
            <config-property name="TransactionIsolation"


            Please let me know if you find anything wrong with the xml file or code.


            • 3. Re: Commit problem in session bean using CMT
              Bernd Zeitler Expert

              Is your ejb-jar.xml ok? (The assembly descriptor describing the container transaction)