Skip to content

Add LocalSessionFactoryBean.validateDatabaseSchema() [SPR-3212] #7898

@spring-projects-issues

Description

@spring-projects-issues

Kalle Korhonen opened SPR-3212 and commented

There's create-, drop- and updateDatabaseSchema() operations in LocalSessionFactoryBean. For completeness, add validateDatabaseSchema(). This is useful if your application doesn't have permissions to modify the schema itself. If using hibernate, one cannot auto-validate the scema in a webapplication because context loading would fail with HibernateException if schema has changed, so the application would need to validate the schema at a later point. You could also consider adding a strategy for supporting hibernate.hbm2ddl.auto=validate.

In Hibernate, schema validation can be performed with:
SchemaValidator validator = new SchemaValidator(configuration);
validator.validate();

Thread this is discussed:
http://forum.springframework.org/showthread.php?t=35274


Affects: 2.0.2

Referenced from: commits b370969

3 votes, 3 watchers

Metadata

Metadata

Assignees

Labels

in: dataIssues in data modules (jdbc, orm, oxm, tx)type: enhancementA general enhancement

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions