Hibernate 4 incompatibilities

56 views
Skip to first unread message

nabils

unread,
Feb 11, 2012, 7:30:27 AM2/11/12
to Hibernate Profiler
I am trialing hibernate profiler with 4.0.1.Final. However there seem
to be some issues that are not present when I switch to 3.6.9.Final
using the exact same code/configuration.

Issues are:

1) statistics don't show up even with the "generate_statistics"
property on.
2) the transaction lines never seem to show in the profiler.

Would like to purchase this but obviously need this issues fixed
first.

Thanks,
Nabil

Oren Eini (Ayende Rahien)

unread,
Feb 11, 2012, 7:36:42 AM2/11/12
to hibernate...@googlegroups.com
Yes, this is a known issue and something that we are actually currently working on.
We will have a release for Hib 4.0 soon (a week or so)

nabils

unread,
Feb 11, 2012, 7:39:46 AM2/11/12
to Hibernate Profiler
You can reproduce with the code below using hibernate 4.0.1.Final:

Properties properties = new Properties();
        properties.setProperty("hibernate.dialect",
"org.hibernate.dialect.SQLServer2008Dialect");
        properties.setProperty("hibernate.connection.driver_class",
"net.sourceforge.jtds.jdbc.Driver");
        properties.setProperty("hibernate.connection.url",
"jdbc:jtds:sqlserver://localhost/
AdventureWorks;user=sa;password=sa;instance=sqlexpress");
        properties.setProperty("hibernate.connection.isolation", "2");
        properties.setProperty("hibernate.generate_statistics",
"true");
        Configuration configuration = new Configuration()
                .addFile(new File("src/main/java/org/test/spring/
domain/hbm/Person.hbm.xml"))
                .addProperties(properties);

       HibernateProfiler.initialize();
       //HibernateProfiler.initializeOfflineProfiling("hprof.log");

       ServiceRegistry serviceRegistry = new
ServiceRegistryBuilder().applySettings(configuration.getProperties()).buildServiceRegistry();
       SessionFactory sessionFactory =
configuration.buildSessionFactory(serviceRegistry);

        Session session = sessionFactory.openSession();

        try {
            Transaction tx = session.beginTransaction();
            try {
                System.out.println(((Person) session.get(Person.class,
1)).getFirstName());
                tx.commit();
            } catch (Throwable t){
                tx.rollback();
            }
        } finally {
            session.close();
        }

On Feb 11, 12:30 pm, nabils <alt%shuhaiber....@gtempaccount.com>
wrote:

nabils

unread,
Feb 11, 2012, 7:41:02 AM2/11/12
to Hibernate Profiler
Great thanks.

There is also an issue with Hibernate 3 where transaction isolation
level always seems to show up as Unknown. Is that an issue too?

On Feb 11, 12:36 pm, "Oren Eini (Ayende Rahien)" <aye...@ayende.com>
wrote:
> Yes, this is a known issue and something that we are actually currently
> working on.
> We will have a release for Hib 4.0 soon (a week or so)
>
> On Sat, Feb 11, 2012 at 2:30 PM, nabils
> <alt%shuhaiber....@gtempaccount.com>wrote:

Oren Eini (Ayende Rahien)

unread,
Feb 11, 2012, 7:41:32 AM2/11/12
to hibernate...@googlegroups.com
Yes

Daniel Tabuenca

unread,
Apr 20, 2012, 10:03:37 PM4/20/12
to hibernate...@googlegroups.com
Did this ever make it in? I'm still having issues  with class not found with hibernate 4.x

Oren Eini (Ayende Rahien)

unread,
Apr 21, 2012, 4:19:19 AM4/21/12
to hibernate...@googlegroups.com, Eric Hauser
We haven't released Hib 4.0 support yet, 

Fitzchak Yitzchaki

unread,
Jan 15, 2013, 4:21:15 AM1/15/13
to hibernate...@googlegroups.com
Please try to use the build 2112, we included there support for hibernate 4:
Reply all
Reply to author
Forward
0 new messages