1 Reply Latest reply on Jan 30, 2002 4:07 PM by dsundstrom

    Transaction attribute RequiresNew for CMP

    ralph

      Hi all
      i am running JBOSS2.2.1 with a oracle database (with JDBC driver)

      i have a session bean like that

      <ejb-name>ImsTypeController</ejb-name>
      de.alcatel.cmcsdoc.util.ImsTypeControllerHome
      de.alcatel.cmcsdoc.util.ImsTypeController
      <ejb-class>de.alcatel.cmcsdoc.util.ImsTypeControllerBean</ejb-class>
      <transaction-type>Container</transaction-type>
      <session-type>Stateless</session-type>
      <resource-ref>
      <res-ref-name>jdbc/Oracle</res-ref-name>
      <res-type>javax.sql.DataSource</res-type>
      <res-auth>Container</res-auth>
      </resource-ref>


      a method in the bean (start_documents) calls a method (save()) of a normal server class.
      This method (save())calls a PL/SQL proceduce in the Oracle Database.
      AutoComit of the JDBC is set to False.
      Now i want to commit Database changes after each call of the method in the session bean.

      So the deployment descriptor looks like this:
      <assembly-descriptor>
      <container-transaction>

      <ejb-name>ImsTypeController</ejb-name>
      <method-name>start_documents</method-name>

      <trans-attribute>RequiresNew</trans-attribute>
      </container-transaction>
      </assembly-descriptor>

      But it does not work. If i call the method start_documents
      during a while-loop i see the data in the database only at the end of the loop.
      I expect to see database updates after each while.

      Any ideas ??

      kind regards
      Ralph