1 Reply Latest reply on Apr 26, 2002 1:50 PM by David Jencks

    using alternate datasources with jboss-3.0.0RC1 and CMP2.0

    Pete Luellen Newbie

      I've been having some difficulty getting jboss-3.0.0RC1 to use a MySql datasource with CMP2.0 entity beans.

      I'm able to deploy my application and use MySql when the application is CMP1.0. When I change my ejb-jar.xml DOCTYPE to 2.0, jboss appears to ignore my jaws.xml file (?) and use DefaultDS as the datasource.

      When I start jboss (or deploy my application file), I get

      10:32:32,373 INFO [EjbModule] Creating
      10:32:32,443 INFO [EjbModule] Deploying UserBean
      10:32:33,775 INFO [EjbModule] Deploying UserManagerBean
      10:32:36,148 INFO [EjbModule] Created
      10:32:36,148 INFO [EjbModule] Starting
      10:32:36,248 INFO [UserBean] Table 'USERBEAN' already exists
      10:32:36,278 INFO [EjbModule] Started

      even though I've designated a different table name (other than 'USERBEAN') in my jaws.xml file:


      java:/MySqlDS
      <type-mapping>mySQL</type-mapping>

      <default-entity>
      <create-table>true</create-table>
      <remove-table>true</remove-table>
      <tuned-updates>false</tuned-updates>
      <read-only>false</read-only>
      <time-out>300</time-out>
      <select-for-update>false</select-for-update>
      </default-entity>

      <enterprise-beans>

      <ejb-name>UserBean</ejb-name>
      <table-name>tbl_user0</table-name>
      <cmp-field>
      <field-name>email</field-name>
      <column-name>email</column-name>
      <jdbc-type>VARCHAR</jdbc-type>
      <sql-type>VARCHAR(50)</sql-type>
      </cmp-field>
      <cmp-field>
      <field-name>password</field-name>
      <column-name>password</column-name>
      <jdbc-type>VARCHAR</jdbc-type>
      <sql-type>VARCHAR(50)</sql-type>
      </cmp-field>

      </enterprise-beans>



      Furthermore, no 'USERBEAN' table is created or exists in my MySql database.

      As I say, I don't have these difficulties when using a CMP1.0 entity bean and ejb-jar.xml file.

      Any suggestions? Thanks.