[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: [eclipselink-users] multiple PUs/db catalogs ?
- From: James Sutherland <jamesssss@xxxxxxxxx>
- Date: Wed, 16 Jul 2008 06:39:39 -0700 (PDT)
- Delivered-to: firstname.lastname@example.org
Please post separate questions as separate posts.
Do you have a separate database for each customer, or all they all on the
same database, just in different schemas?
Essentially you need a separate persistence unit for each schema/database.
They can all share the same classes and annotations/orm.xml, but each would
needs its own persistence.xml. You can use a SessionCustomizer to set the
tableQualifier on the EclipseLink Session's DatabaseLogin, to set the
schema. There should be a persistence unit property for the tableQualifier,
please log a bug for this.
If you need to create the persistence unit's dynamically, this is more
difficult. Dynamic persistence units is not something JPA or EclipseLink
supports very well. You could potentially create your own
EntityManagerFactory factory that handles dynamically creating an
EntityManagerFactory per customer. You will need to manually create an
EclipseLink ServerSession using the same EclipseLink Project as your default
persistence unit and wrap it in an EclipseLink EntityManagerFactory. If you
need this, you should also log an enhancement request for dynamic
persistence unit support.
Gustav Trede-2 wrote:
> How does people using j2ee/jpa/eclipselink handle the scenario where the
> same logic db structure needs to exists in several instances?.
> one DB catalog for each customer.
> message driven bean per customer , each mdb needs an entitymanager with
> its specific catalog.
http://wiki.eclipse.org/User:James.sutherland.oracle.com James Sutherland
EclipseLink , http://www.oracle.com/technology/products/ias/toplink/
Wiki: http://wiki.eclipse.org/EclipseLink EclipseLink ,
Forums: http://forums.oracle.com/forums/forum.jspa?forumID=48 TopLink ,
Book: http://en.wikibooks.org/wiki/Java_Persistence Java Persistence
View this message in context: http://www.nabble.com/RE%3A-multiple-PUs-db-catalogs---tp18487653p18487653.html
Sent from the EclipseLink - Users mailing list archive at Nabble.com.