atom feed6 messages in org.apache.tapestry.devRe: Upgrading tapestry-hibernate to H...
FromSent OnAttachments
Jochen FreyMar 21, 2012 10:30 pm 
Kalle KorhonenMar 21, 2012 11:22 pm 
Jochen FreyMar 22, 2012 11:23 am 
Kalle KorhonenMar 22, 2012 6:53 pm 
Jochen FreyMar 22, 2012 10:37 pm 
Kalle KorhonenMar 22, 2012 11:25 pm 
Subject:Re: Upgrading tapestry-hibernate to Hibernate 4.1.1
From:Kalle Korhonen (kall@gmail.com)
Date:Mar 21, 2012 11:22:59 pm
List:org.apache.tapestry.dev

On Wed, Mar 21, 2012 at 10:30 PM, Jochen Frey <joc@jochenfrey.com> wrote:

Hello Developers, For a a variety of reasons I want to upgrade to Hibernate 4.1, the most
important one being that a major bug that the Criteria API had in 3.6.0 got
fixed.

Hey Jochen! Perhaps this is a user question more than a developer question.

I managed to do this by modifying tapestry-hibernate-core/build.gradle by
changing the hibernate version, and adding the the jboss logger to the
dependency list, which was required since the dependency on hibernate-core is
non-transitive. With those changes in place I was able to run the Tapestry unit tests, and our
system tests out fine, and after building a binary distro from the source I seem
to be doing fine.

Right, you didn't need to change any code, so there's no benefit just compiling against Hibernate 4.1.1, but obviously running the tests against it makes sense.

I have tried to make this happen by way of changing our pom.xml to exclude
Hibernate 3.6.0 from the tapestry-hibernate dependency and including Hibernate
4.1.1 as a separate dependency, but that hasn't worked for me (in the time
alloted).

Why didn't it work? You shouldn't even need to exclude anything, you should be able to just specify hibernate-core 4.1.1 in your app pom and the nearest version resolution takes care of picking up the desired version. m2eclipse (if you are using eclipse) has a good dependency hierarchy view that you can use to resolve conflicting versions and to exclude dependencies if you need to.

Just as a test I ran tynamo's tapestry-hibernate-seedentity against 4.1.1 and after fixing the api changes (the metadata api has some changes that are potentially a problem to tapestry integration) it worked out fine. I'm using tapestry-hibernate 5.3.2. I only added the following to the pom: <dependency> <groupId>org.hibernate</groupId> <artifactId>hibernate-core</artifactId> <version>4.1.1.Final</version> </dependency>

1)  Is there something obviously wrong with this approach (I haven't been
hacking at TS proper that much), and

Nothing that wrong except it seems not to be necessary.

2) Is there an easier way (e.g. removing the "transitive: false" and hoping for
the best)?

Dependencies are yours to manage, even if the tools may help with them. In other words, take transitive dependencies only as the tool's initial guess of what you might need and verify what and which version you need yourself.

Kalle