on 04-09-2010 8:59 AM
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
I found a solution:
<persistence-unit name="DB_A_unit">
<jta-data-source>a_alias</jta-data-source>
<class>CL_A</class>
<exclude-unlisted-classes>true</exclude-unlisted-classes>
</persistence-unit>
<persistence-unit name="DB_B_unit">
<jta-data-source>b_alias</jta-data-source>
<class>CL_B</class>
<exclude-unlisted-classes>true</exclude-unlisted-classes>
</persistence-unit>
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
83 | |
23 | |
11 | |
9 | |
8 | |
5 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.