CacheableFileXmlSource.doBind uses obsolete .bin file

Description

Documentation of org.hibernate.boot.MetadataSources.addCacheableFile(File) suggests that .bin-Files will not be used if .hbm.xml-Files are newer (e.g. updated by the developer).

In fact, lastModificationTime is considered only in strict mode in CacheableFileXmlSource which is true only in your JUinit test environments.
As a result, .bin files ain't updated for .hbml.xml files newer than .bin files and Hibernate will work with obsolete mappings.

I can't find any line of code considering lastModificationTime in case of CacheableFileXmlSource.strict = false, this is why I don't yet attach a reproducer.

Environment

Java 8

Activity

Show:
Selaron
October 30, 2015, 3:33 PM

Just created a pullrequest containing both: test case and fix:
https://github.com/hibernate/hibernate-orm/pull/1127

Steve Ebersole
October 30, 2015, 3:40 PM

Thanks!

Steve Ebersole
October 30, 2015, 6:03 PM

Applied the PR from Selaron. Thanks!

Assignee

Steve Ebersole

Reporter

Selaron

Fix versions

Labels

None

backPortable

None

Suitable for new contributors

None

Requires Release Note

None

Pull Request

None

backportDecision

None

Components

Affects versions

Priority

Major
Configure