It's very well possible to have multiple persistence units in JPA and in JPA with Seam. In Seam it's very easy. Just create more than one <persistence-unit name="myapp" />
elements in your persistence.xml and configure an EntityManagerFactory for each unit, and optionally an EntityManager for each EntityManagerFactory. You can then simply inject any EntityManager in the standard way:
@In
EntityManager entityManagerOne;
where your EntityManager is named entityManagerOne
(and the other entityManagerTwo
).
The most important reason to have multiple persistence units is the requirement to work with multiple database systems. This is not related to a data source, but the issue is simply to define a scope for your entity mappings.
Another reason is that you choose a transaction strategy (global (JTA) or local (resource-local)) per persitence unit. So, if you need to work with multiple transaction strategies you can create 2 persistence units for the same database.