|
From: Yujin K. <net...@gm...> - 2006-03-28 23:26:48
|
Hi We noticed some inconsistent behavior between Spring's LSFB and Hibernate's hbm2ddl SchemaUpdate tool. http://anonhibernate.labs.jboss.com/trunk/Hibernate3/src/org/ hibernate/tool/hbm2ddl/SchemaUpdate.java http://cvs.sourceforge.net/viewcvs.py/springframework/spring/src/org/ springframework/orm/hibernate3/LocalSessionFactoryBean.java? rev=1.29&view=auto It appears LSFB is utilizing db dialect but not the (Hibernate's) DatabaseMetadata which causes the generate script to contain incompatible datatypes. We are doing schema create/drop/update as a part of integration build, and when using hbm2ddl tool, it works fine on mysql/hsql/oracle/ms- sql/psql but if we use LSFB to do the same, it fails on some of the older databases. It appears the DDL script generated by LSFB produces the script that is compatible only with the most updated version of the database, so for example oracle 9i, it generated type "bit" which didn't work on the version of oracle we are running here. Similarly to mysql 4.1, it was trying to look up the database metadata from "information_schema" which appears to be a mysql 5.x thing. While I am not 100% sure whether it was due to the fact LSFB is not passing DatabaseMetadata for script generation, it looks like a good candidate. I think it's pretty clear how LSFB is processing it is slightly different from hbm2ddl tool. While at it, I personally think it will also be useful if LSFB has an option to generate the DDL script to the specific (or default) location to allow more advanced tweaking etc by the dbas later on. I would like to go back to use LSFB to handle the schema generation and hence would provide any support on this issue anyway I can. Thanks Yujin Kim Vivakos, Inc |