Hi all,
I had to port application to PostgreSQL and I found it rather clumsy.
One of the key of EJB/or other good persistance is independence of underlying
DB.
Even if I use EJBQL, portable selects, etc. JBoss-Entity-Beans depend on the DB
type.
1. jbosscmp-jdbc.xml
<jbosscmp-jdbc>
<datasource-mapping>PostgreSQL</datasource-mapping>
2. jbosscmp-jdbc.xml - auto generated keys
<entity-command name="postgresql-fetch-seq">
xx
</entity-command>
3. No abstraction of CLOB-Oralce/TEXT-PostgreSQL.
All those files must be change in order to port to other DB vendor. In my
opinion it is major flaw in design of Entity/persistance layer. This should
never be set in application descriptors. Simply it should depend on the type of
the driver. If driver is Oracle - use datasource-mapping for Oracle, the same
for the sequence. Even if you don't want (or impossible) to do it by detecting
the driver, simply specify it in the jca db xml configuration file.
Hope, there will be refactoring of JBoss to simply the developers work.
But, what now?
I use xdoclet to generate all stubs and descriptors. Two DBs means to me
changes in the .java files. How to deal with:
* @jboss.entity-command name="postgresql-fetch-seq/ or oracle-sql here"
* @jboss.entity-command-attribute name="sequence" value="xxx_sequence"
Should I back 20 years and make some preprocessing (like C #define)? Horrible.
Should I do some postprocessing on descriptors? (a little bit better).
Does someone has good experience with such tiny but ugly configuration?
Thanks,
tbech
View the original post :
http://www.jboss.org/index.html?module=bb&op=viewtopic&p=3872701#3872701
Reply to the post :
http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=3872701
-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
JBoss-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jboss-user