0 Replies Latest reply on Oct 30, 2002 12:00 PM by Anatoli Krassavine

    How to abstract datasource typemapping?

    Anatoli Krassavine Newbie

      Summary:
      I would like to find a way to abstract datasource
      type-mapping from CMP 2.0 entity bean deployment
      descriptor.
      I would like to be able to specify type-mapping
      as part of datasource service deployment not as part
      of entity bean deployment.

      ------------------

      Full issue:
      I have several CMP 2.0 beans which I wish to deploy on different installations against different types of databases (Oracle, DB2, etc).

      With the datasource itself everything is simple -
      I reference a named datasource service via JNDI
      and simply require customers to create an
      appropriately named datasource service on their
      local installation. The problem is that I should also
      specify type-mapping in my jaws.xml and jbosscmp-jdbc.xml
      and for that I need to know the datasource type.

      i.e. currently in entity bean deployment

      java:/xyzDS
      <type-mapping>Oracle8</type-mapping>

      <enterprise-beans>
      .....................

      instead I would like to write something like that

      java:/xyzDS

      <enterprise-beans>
      .....................

      One solution is to request clients to create a
      custom named type-mapping in default-jaws and reference
      it. But this is too heavy and duplicates the data
      which are already available to the system, i.e.
      system should have a default type-mapping for each
      datasource specified.

      Any help is welcome.