Skip to content

Tag Archives: hibernate

Spring, JPA/JTA, and multiple persistence units, with view transactions

I have grappled with this topic before. Tonight, after 13 hours of struggle, I finally got my web app perfected in this regard. It all started when I needed to start the Transaction out in the view, i.e. as soon as the resource is opened on the HTTP side (rather than when the database service […]

Come back Gavin King, all is forgiven (Spring is the new EJB 2.1)

I’ve just spent the past two days trying to make Spring transaction management work with JPA-annotated Hibernate-backed persistence classes that need to have multiple persistence units with transaction propagation REQUIRES_NEW between the two. For a start, the documentation is merely a series of outlines of brief hints. One measly section.The laughably short Spring 3 doco […]

ORM-is-Dead meme

I agree with Stephan, and  Aldo; ORMs increasingly get in the way. Collection mapping is one of those “hello world” problems. (The “hello world” example in the doco looks totally trivial and completely ideal [which is the problem], but suck-in-the-galaxy-greet-it-and-then-map-all-the-stars problem, which is more like what your real app looks like, is far less than […]

Does JPA kill the DAO Pattern?

Oliver Gierke definitely thinks not. And I concur with him. A couple of years ago I got into an running battle with a developer at my old workplace as to whether the JPA architecture abstracted away enough of the persistence to justify eliminating the database layer. My answer was, and still is, certainly not! The […]