Hibernate ORM version 4.1.4 has just been released. This is a minor bug fix release containing 37 bug fixes, See the changelog for the complete list of fixes. Specific fixes of note include:
- HHH-7074 - The @org.hibernate.annotation.Entity annotation had been deprecated for a while to in favor of the JPA one -- @javax.persistence.Entity, to use the features were defined in Hibernate @Entity annotation attributes now should use the new defined annotations, for example, @org.hibernate.annotations.Immutable, see the javadoc for more details. Also, this deprecated @org.hibernate.annotation.Entity will be removed in Hibernate ORM 5.0, so, it would better to start migrate your code now.
- HHH-7306 SessionFactory#openSession() could not be used in a tenant-aware scenario due to this issue, because hibernate could not know which tenant identifier to use, we now have a contract named org.hibernate.context.spi.CurrentTenantIdentifierResolver for Hibernate to be able to resolve what the application considers the current tenant identifier. The fix of this issue also makes using mutil-tenant possible within HEM (still under development, see HHH-7312). To learn more about this, please check out the Dev Guide.
- HHH-7350 A Readonly/Immutable Entity with 2LC enabled should be removable from cache.
- HHH-3961 SQLServerDialect now supports nowait in LockMode.UPGRADE_NOWAIT, thanks Guenther for the pull request.
- HHH-6846 / HHH-6256 / HHH-7356 The
javax.persistence.lock.timeoutsetting was ignored by @NamedQuery, persistence.xml and query hint.
As usual, the artifacts have been uploaded to the JBoss Nexus repository (and will be synchronized to Maven Central in a day or two) and the release bundles have been uploaded to the Hibernate SourceForge in both ZIP and TGZ formats.
Last but not the least, I would like to give special thanks to Lukasz Antoniak and Adam Warski, Hibernate Envers Developers from community and who are helping us on Envers module testing on DB matrix, Lukasz (with Adam's help) worked tirelessly and fixed ALL envers test failures we found, Great work and keep contributing :D
dear hibernate users,
I helped some community users on IRC recently which run into issues when migrating to 4.0, and the most popular issue I'm seeing is caused by the hibernate-anntations module dependency, so, I would like to explain it again.
we MERGED this module into hibernate-core since hibernate core 3.6 release, see the release note of 3.6.
so, maven / gradle users, you just need to add hibernate-core ( and hibernate-entitymanager if you're using JPA ) to your dependency list, and remove hibernate-annotation dependency if it is there.
before hibernate-core 3.5, it was JDK 1.4 compatible, so, to use Annotation, the new feature of JDK 1.5, we had to create a new module, aka, hibernate-annotations
but since we had moved to JDK 1.5 since hibernate-core 3.5, there is no reason to keep hibernate-annotations as a separated module, so, we merged back into hibernate-core.
------------------------ chinese below ---------------------------
我注意到很多人在迁移到hibernate orm 4.x的过程中, 遇到最多的一个问题是关于hibernate-annotations的, 这里, 需要再重申一下, 从hibernate core 3.6开始, 就没有hibernate-annotations这个项目了, 它已经被整合进了hibernate-core, 所以, 如果你在使用hibernate-core 3.6 / 4.x的话, 请把hibernate-annotation这个依赖移除掉 (事实上, 如果有的话, 那你可能在使用错误的版本, 因为根本就不存在 3.6 / 4.x 版本的hibernate-annotations)
在hibernate core 3.2 / 3.3的时代, hibernate-core需要兼容JDK1.4, 所以为了能够使用JDK1.5中出现的annotation, 我们必须创建一个新的项目, 即hibernate-annotations, 而从hibernate-core 3.5开始, 我们抛弃了JDK1.4转向了1.5, 所以, 就没有必要在把annotations放在一个单独的项目当中了.
Hibernate Core 4.0.0.CR7 has just been released. The complete list of changes can be found in the JIRA release notes.
In this release, we have some performance improvement issue resolved, for example:
- HHH-5945 - Race condition in building query cache
- HHH-6845 - Avoid repeated invocations of ReflectHelper.overridesEquals in proxy initializers
- HHH-6858 - Minor performance improvements after hotspots analysis
- HHH-6862 - Reuse cached entryArray of IdentityMap in StatefulPersistenceContext as much as possible
- HHH-6868 - Lazily initialize HashMap in LockOptions
- HHH-6286 - UpdateTimestampsCache should try to avoid acquiring lock if possible
And in this release, we also fixed lots of bugs found with running hibernate tests on supported DB matrix (the matrix is not complicated, we only runs on a small subset of hibernate supported DBs), we're working hard to resolve all failures we found, and keep the CI job clean (the CI job can be accessed here ).
P.S. I really hope this is our last CR release. :D
Dear DB vendors, contributors, and others,
If you would like to run hibernate tests on other DB besides the default one (H2), please read this doc first.
For example, if you're working on a dialect to support your DB, it would better to run hibernate tests on it and make sure all tests pass(or at least, skip the failed test with a JIRA and explain why it should be skipped).
Hibernate Core CI can be viewed here , you can also download the nightly build from here and view javadoc.
Hibernate Core Matrix Testing job is here , currently, we run hibernate tests on :
- DB2 v9.7
- Oracle 11gR1
- Oracle 11gR1 RAC
- Oracle 11gR2
- Oracle 11gR2 RAC
- MySql 5.1
- Sql Server 2008 R1
- Sql Server 2008 R2
- PostgreSql 8.4
- Sybase ASE 15.5
We're choosing these DBs since they are widely used and they are supported by JBoss product , so JBoss QA team maintains them for us, we (hibernate team) do not have resource/time to maintain DB instances for testing.
For other DB(vendors), if you'd like to let us run hibernate tests on your DB, we are happy to add it to our matrix testing job, if you could provide us the DB connection info and maintain the DB instance yourself.
BTW, we're working hard to get all failures fixed before Hibernate Core 4.0 Final release, so, any help would be appreciated :D
I saw someone is asking
what new in Hibernate Core 4.0, so I take sometime and try to summary it here.
first of all, please see:
- the migration guide for 4.0
- JIRA filter link which lists all improvements and new features in Hibernate Core 4.0.0, you can get all details from this link :)
- move to gradle for builds
- Redesign SessionFactory building
- Introduction of services (see this for more details)
- Improved metamodel (not in 4.0.0.Final yet, we planned this, but due to the tasks are more than we expected, and it would take too long to get 4.0 out, so we decided to move this out of 4.0.0.Final but will be upcoming release soon see this for more details, and this is a design document)
- Initial osgi-fication by package splitting (public, internal, spi)
- Support for multi-tenant databases (see this for more details)
- Migration to i18n logging framework (using jboss logging)
- JDK 1.6 (JDBC4) as baseline
- and more (I can't remember all the things :)
Hibernate Core 4.0.0.CR2 has just been released. The complete list of its changes can be found in the JIRA release notes.
- HHH-6586 As Steve said in this post, we will continue new metamodel development after 4.0.0 release, we think the deprecation of Configuration may confuse the community, so in this issue, we removed the deprecation tag from this class, and we will continue to support this API until we get new metamodel ready, at which point this class will become deprecated and scheduled for removal in 5.0.
- HHH-6622 Upgrade to Hibernate Commons Annotations 4.0.0.CR2, now, we have fully moved to jboss logging, no slf4j-api dependency required anymore.
- HHH-6618 We have wrote a new gradle plugin which can be used to run hibernate functional tests on different DBs besides H2, this is useful for community contributors, see hibernate-core/buildSrc/readme.txt for more details.