|Re: Two persistence units, wrong JDBC driver [message #1690518 is a reply to message #1690509]
||Fri, 27 March 2015 19:46
| Bernd Prager
Registered: November 2012
Yes, I have two different deployed persistence units in my log:|
[EL Finest]: jpa: 2015-03-27 15:34:18.821--ServerSession(622033744)--Thread(Thread[Gogo shell,5,main])--End predeploying Persistence Unit projects; session /projects; state Predeployed; factoryCount 0
[EL Finest]: jpa: 2015-03-27 15:34:21.543--ServerSession(1161000327)--Thread(Thread[Gogo shell,5,main])--End predeploying Persistence Unit assignments; session /assignments; state Predeployed; factoryCount 0
On further investigation, I was looking at all the properties within the referenced EntityManagerFactory. The one which is supposed to contain all the Oracle JDBC properties is still getting all the MS JDBC properties.
So the reference to the emf does not seem to work properly.
This is how I reference:
private static final String PERSISTENCE_UNIT_NAME = "assignments";
@Reference(target = ("osgi.unit.name=" + PERSISTENCE_UNIT_NAME))
private EntityManagerFactory emf;
In this case I am still getting the emf for the MS persistence unit "projects" instead of the Oracle "assignments".
According to the documentation on multitenancy, I should not need to create multiple EMFs on my own, since each provider bundle contains its own persistence unit, correct?
Powered by FUDForum
. Page generated in 0.02180 seconds