Hi,
I am currently upgrading my sample project, which was created 3 years ago, to latest version of frameworks, such as Hibernate, Jboss Cache, and Spring.
The issue I am encountering is the SchemaExport did not create foreign key constraints into Mysql when
I am deploying the application on Ubuntu.
I remembered it was generated successfully when I worked on Windows 3 years ago.
so I switch to Windows again and deploy the same application, ah! it got created successfully.
(Verified by all kinds of DB clients: NetBeans built-in DB browers, mysql administrator)
So I collected the log files of the server (Glassfish 3.0.1) from both platforms,
the result is the parts of hbm2ddl.SchemaExport in both log files are almost the same, such as the key part (only the time stamp is different showing in diff):
Code:
INFO: 2010-07-04 03:28:38,051 DEBUG [org.hibernate.tool.hbm2ddl.SchemaExport] (FelixStartLevel:)
alter table Orders
add index FK8D444F05D1AABBE (userId),
add constraint FK8D444F05D1AABBE
foreign key (userId)
references User (userId)
So I am wondering where the problem is,
the jdbc driver? but the version are set in the pom file:
Code:
<spring.version>3.0.3.RELEASE</spring.version>
<hibernate.version>3.5.3-Final</hibernate.version>
<mysql-connectorj.version>5.1.13</mysql-connectorj.version>
<c3p0.version>0.9.1.2</c3p0.version>
<log4j.version>1.2.15</log4j.version>
<jbosscache-core-version>3.2.5.GA</jbosscache-core-version>
<aspectj.version>1.6.8</aspectj.version>
<org.slf4j-version>1.6.0</org.slf4j-version>
Hope someone can help me out.
Thanks,
Pprun
Update:
the version for mysql is:
Code:
Server version: 5.1.37-1ubuntu5.4 (Ubuntu)