Help

The Hibernate team is pleased to announce the release of Hibernate Core 4.0.0.Final. A lot of time and effort from many people went into this release, so thank you everyone involved!

The artifacts have all been published to the JBoss Nexus repository under the org.hibernate groupId. Or if you prefer, the download bundles are available from SourceForge in both ZIP and TGZ formats.

What's new?

A lot of things; too many to list here. But here is a list of the major improvements done in 4.0:

  1. Initial multi-tenancy support. See http://in.relation.to/Bloggers/HibernateAndMultitenancyWebinar and http://in.relation.to/Bloggers/MultitenancyInHibernate for more information.
  2. Introduction of ServiceRegistry. This is a major change in how Hibernate builds and manages services. See the information in the Hibernate Developer Guide.
  3. Clean up of Session opening from SessionFactory
  4. Improved integration via org.hibernate.integrator.spi.Integrator and auto discovery
  5. Improved logging with i18n support and message codes
  6. Initial work on more clear split between API, SPI and implementation classes. If you import a class contained in an internal package, you know that this code is not guaranteed to work between releases.
  7. Clean up of deprecated methods, classes, etc

Also, be sure to check out the Migration Guide.

Documentation

The documentation is caught in a state of flux. The long term story is that we are trying to migrate to use DocBook v5.1 to leverage its new concept of Topics and Assemblies. Additionally we are trying to split up the content into multiple documents rather than the single document we used to produce. Plus the fact that DocBook 5.1 is itself still beta. All that is to say that the documentation is still in a working state.

  1. Hibernate Getting Started Guide is done. It is a series of quick starts and tutorials to help new users get up and running.
  2. Hibernate Reference Documentation is the old documentation. It has been kept somewhat up to date during 4.0 development, so for the time being that is the best resource for most topics.
  3. Hibernate Developer Guide is the guide for application developers using Hibernate. It is largely incomplete, except that it has the only good ServiceRegistry coverage.
  4. Hibernate EntityManager User Guide will eventually get folded into Hibernate Developer Guide (in fact some of it has been folded into Hibernate Developer Guide and Hibernate Reference Documentation already).

This is a mess, I know and I apologize.

Whats ahead?

We had originally planned a major redesign to the Hibernate metamodel (org.hibernate.mapping) code in this 4.0 release, however we decided to delay that to another release for a number of reasons. We recently agreed that those changes would be the bulk of our 5.0 release. In the interim we will have a 4.1 release as well with 2 main changes:

  1. HHH-2879 / HHH-2896 - which deal with providing an actual API for performing natural key lookups.
  2. HHH-5472 - which is a big improvement in cascade performance
  3. We will also get the docs straightened out for 4.1. Partially this is so we wont have to break links based on the 4.0 directory name. But I will get them moved up there ASAP, even before we do the 4.1 release if thats how it works out.

What about 3.6?

We simultaneously released 3.6.9, which is the final 3.6 (in fact, final 3.x) release.

26 comments:
 
16. Dec 2011, 00:32 CET | Link
Cody

Is 4.0.x Final what is planned for AS 7.1?

ReplyQuote
 
16. Dec 2011, 02:17 CET | Link

I see that in 4.0

new Configuration().configure().buildSessionFactory(0

was deprecated now. There's a better way to obtain SessionFactory, especially in non container environment/Java SE?

 
16. Dec 2011, 04:21 CET | Link

Congratulations!

 
16. Dec 2011, 05:59 CET | Link
Cody wrote on Dec 15, 2011 18:32:
Is 4.0.x Final what is planned for AS 7.1?

It's already available in AS7 upstream https://github.com/jbossas/jboss-as/pull/917, so yes it will be in the upcoming AS 7.1 release.

 
16. Dec 2011, 07:57 CET | Link
Grzegorz Grzybek
Congratulations!

I am however afraid of new logging api... Is this how JavaEE is going to work? Someone would rather think that such "pro JavaEE" company would rather choose ... java.util.logging...
So - a great product, strange decisions, a little bit of hipocrisy...
Why:
 - the compile dependency on org.jboss.logging:jboss-logging:3.1.0.CR2 ??? is this where JavaEE is heading?
 - the compile dependency on org.jboss.spec.javax.transaction:jboss-transaction-api_1.1_spec:1.0.0.Final instead of javax.transaction:jta:1.1 ???
 - the compile dependency on org.hibernate.javax.persistence:hibernate-jpa-2.0-api:1.0.1.Final instead of something "standard" ???

Great:
 - dependency on commons-logging:commons-logging:99.0-does-not-exist :)

regards
Grzegorz Grzybek
 
16. Dec 2011, 10:32 CET | Link
Stephane Landelle | slandelle(AT)excilys.com

Congratulations!

Sadly, it seems Hibernate 4 can't be solely retrieved from maven central, as jandex is not deployed there.

Sincerely,

Stephane Landelle

 
16. Dec 2011, 11:01 CET | Link
I am however afraid of new logging api... Is this how JavaEE is going to work? Someone would rather think that such pro JavaEE company would rather choose ... java.util.logging...

java.util.logging is in SE, not simply EE and frankly pretty much everyone agrees it's under featured and that the implementation is not good enough. Besides JBoss had specific needs with regards to internationalization and log id generation that was not available elsewhere. That's why JBoss Logging came up.

Do not worry however, this should be transparent for you as JBoss Logging delegates to your favorite logging system. It can even be java.util.logging if you want to :)

So - a great product, strange decisions, a little bit of hipocrisy... Why: - the compile dependency on org.jboss.logging:jboss-logging:3.1.0.CR2 ??? is this where JavaEE is heading?

See above.

- the compile dependency on org.jboss.spec.javax.transaction:jboss-transaction-api1.1spec:1.0.0.Final instead of javax.transaction:jta:1.1 ???

Oracle / Sun has a very bad track record for pushing the javax.* artifacts to a Maven repo with a decent license. We thus do implement our own but realize that these artifacts are 100% spec compliant: the TCK tests these signatures. There are the exact same classes essentially. I believe the guys at Apache follow the same strategy.

- the compile dependency on org.hibernate.javax.persistence:hibernate-jpa-2.0-api:1.0.1.Final instead of something standard ???

This is 100% standard and proof is we pass the TCK. This is the same reasoning as javax.transaction.

Hope that clarifies things.

 
16. Dec 2011, 15:16 CET | Link

Just to follow up on Emmanuel's reply a little bit more in regards to the spec jars...

We are just talking about signature bindings here. Each artifact referenced, as Emmanuel pointed out, does pass the respective TCK signature tests. If you feel that strongly about using one particular spec artifact over another (there are many in fact because of the licensing problem) then simply exclude the ones Hibernate pulls in substitute your own.

IMHO, this actually illustrates a failing in the Maven repository metadata and its artifact resolution in general. In fact, there have been numerous proposals to the Maven team about fixing this.

 
16. Dec 2011, 15:21 CET | Link
xsalefter wrote on Dec 15, 2011 20:17:
I see that in 4.0
new Configuration().configure().buildSessionFactory(0
was deprecated now. There's a better way to obtain SessionFactory, especially in non container environment/Java SE?
/**
 ...
 * @deprecated Use {@link #buildSessionFactory(ServiceRegistry)} instead
 */
public SessionFactory buildSessionFactory() ...
 
16. Dec 2011, 15:29 CET | Link
Stephane Landelle wrote on Dec 16, 2011 04:32:
Congratulations! Sadly, it seems Hibernate 4 can't be solely retrieved from maven central, as jandex is not deployed there. Sincerely, Stephane Landelle

This seems to be simply an oversight on the JBoss-to-Central synch. I'll follow up. Thanks Stephane.

 
17. Dec 2011, 06:51 CET | Link
Iman

The most useless hibernate release ever

 
18. Dec 2011, 06:10 CET | Link
Grzegorz Grzybek

@Emmanuel

java.util.logging is in SE, not simply EE and frankly pretty much everyone agrees it's under featured and that the implementation is not good enough. Besides JBoss had specific needs with regards to internationalization and log id generation that was not available elsewhere. That's why JBoss Logging came up.
Do not worry however, this should be transparent for you as JBoss Logging delegates to your favorite logging system. It can even be java.util.logging if you want to :)

I was a little bit sarcastic :) Of course I'd never use JUL - I'm just glad you're not going the Vanilla JavaEE way and just use whatever seems to be well suited for your needs. If you were going to be vanilla, you'd grit your teeth and use java.util.logging :)

I'm going to check Hibernate 4 on WebSphere 6 - these beasts are still in production...

regards Grzegorz Grzybek

 
18. Dec 2011, 08:05 CET | Link

@Steve

My question actually is, Is there any example about how to creating service registry to build SessionFactory easily? Another things is that I try to build an EntityManagerFactory programmatically using Ejb3Configuration class but always get:

javax.persistence.PersistenceException: Unable to build EntityManagerFactory etc etc.

You could see in my github repo.

Oh and there's some typo in the documentation:

cfg.addProperties( properties ) 
     .setInterceptor( myInterceptorImpl )
     .addAnnotatedClass( MyAnnotatedClass.class )
     .addClass( NonAnnotatedClass.class )
     .addRerousce( "mypath/MyOtherCLass.hbm.xml )   // This is should be "addResource()", right?
     .addRerousce( "mypath/orm.xml ) // This is should be "addResource()", right?
     .configure("/mypath/hibernate.cfg.xml") 
     .buildEntityManagerFactory();
 
19. Dec 2011, 13:47 CET | Link
Guenther Demetz

Latest Hibernate-Tools version 3.4.0.CR2-SNAPSHOT is not compatible with Hibernate-Core 4.0 Final, so currently it is not possible to bootstrap a database with ant. When it is planned a Hibernate-Tools release compatible to Hibernate-Core 4.0 Final ?

 
19. Dec 2011, 19:03 CET | Link
Greg

Still not available via Maven

 
19. Dec 2011, 20:13 CET | Link
dfl

Since the documentation is still such a mess, it seems weird that 4.0 is GA doesn't it? Seems a bit contradictory -- I thought we were getting over the whole open source syndrome of considering documentation a second class artifact.

 
20. Dec 2011, 07:34 CET | Link
Atul Gupta | atul.gupta(AT)rbs.com

Hi,

Is this compatible with Oracle 11g officaly.

My current application uses hibernate 3.2.6, JDK1.6, Oracle 11G deployed on Solaris sparc 64bit and tomcat5. with in sometime queries become slower and slower and finally the application freezes.

Earlier it used to work fine with JDK1.5, Oracle 10g.

Please advise.

 
22. Dec 2011, 20:48 CET | Link
Mark
Iman wrote on Dec 17, 2011 00:51:
The most useless hibernate release ever

So I guess Hibernate has pretty much implement everything you will ever need?

 
22. Dec 2011, 20:51 CET | Link
Mark
Atul Gupta wrote on Dec 20, 2011 01:34:
Hi, Is this compatible with Oracle 11g officaly. My current application uses hibernate 3.2.6, JDK1.6, Oracle 11G deployed on Solaris sparc 64bit and tomcat5. with in sometime queries become slower and slower and finally the application freezes. Earlier it used to work fine with JDK1.5, Oracle 10g. Please advise.

That does not sound like a Hibernate problem. It could be your database driver. Or just a setting.

Were you using hibernate 3.2.6 with JDK1.5, Oracle 10g?

 
26. Dec 2011, 02:56 CET | Link
Greg wrote on Dec 19, 2011 13:03:
Still not available via Maven

I see it both in Maven Central repo and the JBoss repo...

 
28. Dec 2011, 07:33 CET | Link
Iman
Mark wrote on Dec 22, 2011 14:48:
Iman wrote on Dec 17, 2011 00:51:
The most useless hibernate release ever
So I guess Hibernate has pretty much implement everything you will ever need?

Hardly. Maybe the hibernate team could check only a few of its users top priorities and try implementing them.

 
30. Dec 2011, 00:05 CET | Link
dfl
Iman, those are all difficult and/or messy items that would involve a lot of vendor-specific hacking. It would be a lot more fun to spend a year re-architecting the core, don't you agree? And the logging is all new!
 
06. Jan 2012, 15:34 CET | Link
dfl wrote on Dec 19, 2011 14:13:
Since the documentation is still such a mess, it seems weird that 4.0 is GA doesn't it? Seems a bit contradictory -- I thought we were getting over the whole open source syndrome of considering documentation a second class artifact.

I tried to explain why it is the way it is. There are lots of moving parts here. I want to use DocBook 5.1 and (1) DocBook 5.1 is still in beta and (2) the DocBook team have asked that the betas not be put in Maven repos (which our plugins rely on). So what else would you have suggested?

Of course documentation is important. The Hibernate team generally does a very good job in regards to documentation. In fact we write and maintain the most popular documentation plugins for both Maven and Gradle (well we recently handed over maintenance for the Maven one since we no longer have a vest interest there).

I already apologized for the documentation being in this state. I don't owe you any more than that. Hibernate is a community. If you feel that strongly about it, maybe you could, oh I don't know, actually volunteer to help out? The major tenant of Open Source after all is that notion of vested interest.

 
06. Jan 2012, 15:37 CET | Link
dfl wrote on Dec 29, 2011 18:05:
Iman, those are all difficult and/or messy items that would involve a lot of vendor-specific hacking. It would be a lot more fun to spend a year re-architecting the core, don't you agree? And the logging is all new!

Some things require other things be done in order to complete them. Its this thing called dependencies. Yeah we could have built castles on the sand, but heck even Jimi Hendrix know what happens to those eventually.

 
11. Jan 2012, 14:21 CET | Link
Sikinder

Congratulations Hibernate Team for such wonderful work.

 
31. Aug 2014, 10:46 CET | Link
jack

Thank you for another informative blog. Where else could carpet cleaning bordentown I get that kind of info written in such a perfect way? I have a project that I am just now working on, and I have been on the look out for such information.

Post Comment