7 Replies Latest reply on Mar 5, 2002 10:45 AM by Michael Fortin

    CMP bean not inserting into oracle db

    Michael Fortin Newbie

      I've had no trouble creating a database connection and accessing existing beans in the database but when I try to call a create method on the bean below, I do not get any errors but my bean is never inserted into the database. Subsequent calls to create give me an "CreationException that id already exists" but if I restart jboss they're lost. The class seems to be in memory but the bean is never commited. Is there some commit flag I need to set that I don't know about? I've spent entirely to much time on this and would greatly appreciate any help.

      jaws.xml
      --------------

      java:/OracleDS
      <type-mapping>Oracle8</type-mapping>
      true

      <enterprise-beans>

      <ejb-name>fullAccessMedical/Employee</ejb-name>

      <cmp-field>
      <field-name>email</field-name>
      <column-name>email</column-name>
      <sql-type>VARCHAR2(48)</sql-type>

      </cmp-field>
      <cmp-field>
      <field-name>firstName</field-name>
      <column-name>first_name</column-name>
      <sql-type>VARCHAR2(30)</sql-type>

      </cmp-field>
      <cmp-field>
      <field-name>keyval</field-name>
      <column-name>keyval</column-name>
      <sql-type>NUMBER(16)</sql-type>

      </cmp-field>
      <cmp-field>
      <field-name>lastName</field-name>
      <column-name>last_name</column-name>
      <sql-type>VARCHAR2(30)</sql-type>

      </cmp-field>
      etc....
      <table-name>employee</table-name>
      <create-table>false</create-table>
      <remove-table>false</remove-table>



      ejb-jar.xml
      ----------------



      <ejb-name>fullAccessMedical/Employee</ejb-name>

      com.fullAccessMedical.user.interfaces.EmployeeHome
      com.fullAccessMedical.user.interfaces.Employee

      <ejb-class>com.fullAccessMedical.user.ejb.EmployeeCMP</ejb-class>
      <persistence-type>Container</persistence-type>
      <prim-key-class>java.lang.Integer</prim-key-class>
      False
      <cmp-version>1.x</cmp-version>
      <abstract-schema-name>fullAccessMedical/Employee</abstract-schema-name>
      <cmp-field>
      <![CDATA[the primary key in the database]]>
      <field-name>keyval</field-name>
      </cmp-field>
      <cmp-field>
      <![CDATA[employees first name]]>
      <field-name>firstName</field-name>
      </cmp-field>
      <cmp-field>
      <![CDATA[employees last Nme]]>
      <field-name>lastName</field-name>
      </cmp-field>
      ...etc...
      <primkey-field>keyval</primkey-field>



      jboss.jcml
      --------------------
      <!-- oracle data source for our database -->

      OracleDS
      org.jboss.pool.jdbc.xa.wrapper.XADataSourceImpl
      jdbc:oracle:thin:@172.22.1.1:1521:ddb
      user
      pwd
      true




      thanks Michael Fortin