Hello, im trying to migrate my project from Hibernate 3.0.5 to 3.2.4 SP1.
The first problem is that Hibernate seems to loop over my mappings several times, instead of mapping everthing once.
My SessionFactory is configured via Spring XML config and mapping property is described like this:
Code:
<property name="mappingLocations">
<value>classpath*:app/**/*.hbm.xml</value>
</property>
With Hibernate 3.0.5 this works perfectly.
Another problem is that when i leave Hibernate looping thru these mappings for like 7-10 minutes, it finally halts with an Exception.
Code:
org.hibernate.HibernateException: Wrong column type: phone_approved, expected: bit
at org.hibernate.mapping.Table.validateColumns(Table.java:261)
at org.hibernate.cfg.Configuration.validateSchema(Configuration.java:1083)
at org.hibernate.tool.hbm2ddl.SchemaValidator.validate(SchemaValidator.java:116)
at org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:317)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1294)
at org.springframework.orm.hibernate3.LocalSessionFactoryBean.newSessionFactory(LocalSessionFactoryBean.java:805)
at org.springframework.orm.hibernate3.LocalSessionFactoryBean.buildSessionFactory(LocalSessionFactoryBean.java:745)
at org.springframework.orm.hibernate3.AbstractSessionFactoryBean.afterPropertiesSet(AbstractSessionFactoryBean.java:134)
That phone_approved field is defined in my XML mapping like this:
Code:
<property name="phoneApproved" type="java.lang.Boolean" not-null="true" length="1"/>
And in the database (using MySQL 5.0) as a tinyint(1) with default value 0.
I cant quite figure out what is needed to be changed or what could be wrong.... Would appreciate some help.