This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 230867 - Outdated version of Hibernate is used when creating a PU with Hibernate provider
Summary: Outdated version of Hibernate is used when creating a PU with Hibernate provider
Status: RESOLVED FIXED
Alias: None
Product: javaee
Classification: Unclassified
Component: Persistence (show other bugs)
Version: 7.4
Hardware: All All
: P3 normal (vote)
Assignee: Sergey Petrov
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-06-06 14:35 UTC by Petr Jiricka
Modified: 2013-12-25 09:38 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Petr Jiricka 2013-06-06 14:35:05 UTC
1. Create a Maven web project (Java EE 6, GlassFish 4 target server)
2. Create a persistence unit in this project, use "Hibernate (JPA 2.0)" persistence provider

=> pom.xml contains the following:
        <dependency>
            <groupId>org.hibernate</groupId>
            <artifactId>hibernate-core</artifactId>
            <version>3.6.10.Final</version>
        </dependency>
        <dependency>
            <groupId>org.hibernate</groupId>
            <artifactId>hibernate-entitymanager</artifactId>
            <version>3.6.10.Final</version>
        </dependency>
        <dependency>
            <groupId>org.hibernate</groupId>
            <artifactId>hibernate-commons-annotations</artifactId>
            <version>3.2.0.Final</version>
        </dependency>

This is an outdated version, the latest version should be used instead.
Comment 1 Sergey Petrov 2013-06-06 16:39:07 UTC
3.6.10 in 7.4 is jpa 2.0 provider, we can't bundle 3.6.10 for framework support and some latest 4.x for persistence purpose in my opinion, in general we can say we supply only one main provider as latest - eclipselink and other providers may be either not latest or not bundled at all.
maven have some specific issues also, I'll check after a few days.
Comment 2 Petr Jiricka 2013-06-18 13:52:33 UTC
> we can't bundle 3.6.10 for framework support

Did you mean "we can't bundle 4.x"?

In that case I am thinking if enhancement issue 231443 could help - we would continue to physically bundle 3.6.10, but the IDE would also have the knowledge of 4.x via the "Maven only library" described in the issue above, and this library would be offered in the persistence providers combo box.
Comment 3 Sergey Petrov 2013-06-18 14:00:01 UTC
yes, "can't" was about 4.x and it wasn't "can't" completely but with a lot of time resources. but now I'm not sure, it may be easier but I need more time to verify anyway.

regarding library binded to hibernate provider, it may not be possible without #171973 fix. if "maven only" will have the same jpa version as bundled one, only one will be chosen but if maven one will be jpa 2.1 both may be shown and are used.
Comment 4 Sergey Petrov 2013-08-07 11:39:31 UTC
With no much resources we can't update with each new release, I would like to update after hibernate with jpa2.1 support release.

also current use case
"1. Create a Maven web project (Java EE 6, GlassFish 4 target server)
2. Create a persistence unit in this project, use "Hibernate (JPA 2.0)"
will not work anyway, because gf4 do not support neither 3.x nor 4.x hibernate as jpa2.0 provider.
Comment 5 Sergey Petrov 2013-10-04 09:43:17 UTC
we have a strong dependency on hibernate tools, with the issue like https://bugzilla.redhat.com/show_bug.cgi?id=867418 I have to stay with 4.1.1 hibernate for now, attempt to update to 4.2.6 failed because of the issue, it may be a problem for 4.3/5.x update also.
Comment 6 Sergey Petrov 2013-10-04 15:06:37 UTC
I'm figting with pojo generation now and have some classloader issues, my custom classloader isn't used at all, wonder if https://hibernate.atlassian.net/browse/HHH-7084 may be related and it may be a stopper in this case as one issue cause 4.1.1- usage when another force 4.1.4+
Comment 7 Sergey Petrov 2013-10-07 12:22:43 UTC
should be updated now to 4.2.6 but have to keep some old jars for framework support. need to look at future development of hibernate-tools is there will be any to remove obsolete parts.
Comment 8 Sergey Petrov 2013-12-25 09:38:35 UTC
better to file separate task for artifact jars