Category Archives: JPA

Spring 3, Hibernate JPA, Tomcat transactions

I tried to deploy a webapp that uses Spring 3, JPA with the Hibernate implementation and Tomcat. There are domain classes with a DAO layer which is called from the Service layer. The classes are annotated correctly. All of the unit tests work. Actually the whole webapp works deployed on other web containers : but […]

Also posted in Hibernate, Spring Framework | Tagged , , | Leave a comment

Spring STS 2.6 JPA template project

Here are a few tips on using the JPA project template included in the Eclipse based SpringSource Tool Suite (STS) (currently at version 2.6) which is a free download from SpringSource. Createe a JPA “utility” project (New->Spring Template Project then choose Simple Spring JPA Utility Project). This generates a lot more than just an empty […]

Also posted in Hibernate, Spring Framework | Leave a comment

Spring, BasicDataSource and OpenJPA

So you want to use Spring with commons BasicDataSource and OpenJPA? There is an interesting gotcha. Let’s start with just the DriverManager DataSource for comparison. In your spring context you define the datasource like this:

Then your EntityManager Factory:

Here META-INF/persistence.xml is almost empty because all the properties are specified here in Spring. […]

Also posted in Spring Framework | Tagged , , , | 1 Response

Multiple Persistence Units – Websphere v7, OpenJPA

Want to do something exotic like specifying two persistence units in your persistence.xml file? Perhaps one local and one JTA managed. Maybe even go whole hog and do that to write unit tests? In Websphere v7 (RAD 7.5) when you have multiple PUs in persistence.xml it barfs like this:

Here is IBM’s “help”: […]

Also posted in Websphere | Tagged , , | Leave a comment

Europa woes with JPA and Dali

I was looking forward to the Europa Eclipse release. There are nice things included. But,… For an all-in-one jee download you also had to go to the update manager to download DTP “enablement” to do anything. Poor out-of-the-box experience right away. After updating and rebooting I get this in a dialog box after the “resynching” […]

Also posted in IDE | Tagged , , | 1 Response