[jbossseam-issues] Multiple Datasources with Seam-Generated POJO entities, creates all tables in both datasources
Ian Darwin
ian at darwinsys.com
Thu Oct 11 14:33:50 EDT 2007
Summary of previous posts:
http://lists.jboss.org/pipermail/jboss-user/2007-January/036530.html
http://lists.jboss.org/pipermail/jboss-user/2007-January/032850.html
Both give a general how-to story
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4071027#4071027
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4034669#4034669
Both give partial examples, ending with
Code:
@PersistenceContext(unitName="db1-PU")
private EntityManager db1EntityManager;
There are two problems:
1) The seam-gen created code doesn't use an explicit EntityManager, but
just an @Entity-annotated POJO for the model and two helper classes,
ClassNameHome (extends EntityHome<ClassName>) and ClassNameList extends
EntityQuery, neither of which has an EntityManager field. Annotating the
various classes with the PersistenceContext does not help.
Secondly, perhaps as a result, all the entities get created in both
databases.
Third, how can we make sure that import.sql is only applied against
one of the datasources?
TIA
Ian Darwin
More information about the seam-issues
mailing list