Talking to multiple database types with Cayenne.

From: Michael Shea (mik..itido.com)
Date: Mon Oct 20 2008 - 11:42:17 EDT

  • Next message: Andrus Adamchik: "Re: Talking to multiple database types with Cayenne."

    Hi guys,

    I am working on a project in which I have to support multiple database
    types. They do not have to be supported simultaneously - I need my
    program to be able to run whether I am using an Oracle database or a
    MySQL database (the databases will have the same schema), but the
    database type does not change at runtime.

    I am wondering if there are any best practices or recommendations for
    how to approach this problem. Currently, I am planning on simply
    creating two sets of cayenne configuration files in different
    directories (ie, a map.xml and a cayenne.xml file), and just adding one
    or the other of these directories to the classpath, depending on some
    initial configuration parameters that tell me what type of database I'm
    accessing. The datasource is defined via JNDI.

    Does anyone think that this is a good idea or a bad idea, or have a
    better way of doing this? =) I am using Cayenne 2.0.4.

    Thanks!

    Mike Shea.



    This archive was generated by hypermail 2.0.0 : Mon Oct 20 2008 - 11:42:56 EDT