Skip to Content
0
Former Member
Apr 09, 2010 at 07:59 AM

Multiple persistent units

22 Views

Hi,

I have one EJB project with two beans refering to two different data bases using two persistence units.

Bean A - persistence unit DB_A_unit - entity class CL_A - table DB_A

Bean B - persistence unit DB_B_unit - entity class CL_B - table DB_B

In persistence.xml I defined both units with different data source aliases.

Now I try to execute a method of bean A and get the exception:

The persistence unit is inconsistent with the database schema

The table DB_B does not exist.

If I try to execute a method of bean B I and get the exception:

The persistence unit is inconsistent with the database schema

The table DB_A does not exist.

Why does a method call in bean A affect the entity of bean B? How can I avoid this?

Thanks,

Kevin