1 Reply Latest reply on Dec 21, 2001 3:45 AM by ipozeng

    Cannot commit a transactional connection

    ipozeng

      Hi,friends
      I have a session bean which manipulate SQL server DBMS through JDBC.The ejb-jar.xml is as below:

      <?xml version="1.0" encoding="Cp1252"?>
      <!DOCTYPE ejb-jar PUBLIC '-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 1.1//EN' 'http://java.sun.com/j2ee/dtds/ejb-jar_1_1.dtd'>
      <ejb-jar>
      <enterprise-beans>

      <ejb-name>CoffeesBean</ejb-name>
      example4/CoffeesHome
      example4/Coffees
      <ejb-class>example4/CoffeesBean</ejb-class>
      <session-type>Stateless</session-type>
      <transaction-type>Container</transaction-type>
      <resource-ref>
      <res-ref-name>jdbc/SQLServerPool</res-ref-name>
      <res-type>javax.sql.DataSource</res-type>
      <res-auth>Container</res-auth>
      </resource-ref>

      </enterprise-beans>
      </ejb-jar>
      The bean works fine when transaction-type is Bean.However it always prints "Cannot commit a transactional connection: See JDBC 2.0 Optional Package Specification section 7.1 (p25)" when the transaction-type is Container.

      What's wrong with it?

      Best Regards!

        • 1. the transaction attributes doesnot function!
          ipozeng

          I have changed the configuration file as below:
          ...
          <ejb-jar>
          <enterprise-beans>

          <ejb-name>CoffeesBean</ejb-name>
          example4/CoffeesHome
          example4/Coffees
          <ejb-class>example4/CoffeesBean</ejb-class>
          <session-type>Stateless</session-type>

          <transaction-type>Container</transaction-type>
          <container-transaction>

          <ejb-name>CoffeesBean</ejb-name>
          <method-name>updateCoffees</method-name>

          <trans-attribute>NotSupported</trans-attribute>
          </container-transaction>

          <resource-ref>
          <res-ref-name>jdbc/SQLServerPool</res-ref-name>
          <res-type>javax.sql.DataSource</res-type>
          <res-auth>Container</res-auth>
          </resource-ref>

          </enterprise-beans>
          </ejb-jar>

          But it always reports the same information :(

          Regards!