|
|
Re: JPA 2.0 non-jta-data-source issue [message #504096 is a reply to message #503774] |
Wed, 16 December 2009 23:00  |
Eclipse User |
|
|
|
Hello James,
Thank you for your reply.
We are discussing the situation where each Singleton has its own EntityManager. You think it seems to be a bad design, I don't agree, but for the sake of the discussion lets stick to the point:
For a JTA data-source, all the entity managers operate over the same Persistence Context.
For a RESOURCE_LOCAL data-source, Eclipse-Link provides each entityManager with each its own persistence unit.
Sun Microsystem's official specification of JPA 2.0 : JSR 317 does not clearly specify that for a RESOURCE_LOCAL data-source, each entity manage must have its own persistence unit, nor does it clearly specify that all the entity managers should use the same persistence unit.
Now lets look at the persistence.xml file :
<?xml version="1.0" encoding="UTF-8"?>
<persistence version="2.0" ...>
<persistence-unit name="BShopPU1" transaction-type="RESOURCE_LOCAL">
<provider>org.eclipse.persistence.jpa.PersistenceProvider</provider >
<non-jta-data-source>...</non-jta-data-source>
</persistence-unit>
</persistence>
Isn't it common sense that all RESOURCE_LOCAL entity managers operate over the same persistence unit?
Why should one create and close an EntityManager per request, or per transaction? Why the extra number of objects and operations?
J2EE version 6 has the official status of final draft, and it is also up to its providers to determine its specifications, just as J2EE 5's JPA 1.0 behaved differently depending on its provider.
Additionally to this discussion I found a bug in EclipseLink's implementation of JPA 2.0 API. Is this forum for bug report or can you point me to the official bug report page?
|
|
|
Powered by
FUDForum. Page generated in 0.03160 seconds