Tag Archives: DataSource

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. […]

Posted in JPA, Spring Framework | Also tagged , , | 1 Response