-
Bug
-
Resolution: Done
-
Major
-
JBossAS-3.2.6 Final
-
None
SourceForge Submitter: bgeddes .
Running Windows 2000, JDK 1.4.2_02, Jboss 3.2.6
I have a relationship between two EJBs associated with
different data sources. When I update the
relationship, it runs a select statement for the
foreign key column being updated, but it runs it using
the datasource for the related ejb. This causes an
oracle error (ORA-00942: table or view does not exist),
since the table does not exist in the other schema.
InventoryMapEJB: datasource1
StatusEJB: datasource2
inventoryMapEJB.setStatus(statusEJB);
This runs: "SELECT inventory_map_id, status_id FROM
INVENTORY_MAP WHERE (inventory_map_id=?)" using datasource2
I believe the problem is in the resolveRelationship
method of the JDBCCMRFieldBridge class. It checks
hasForeignKey() in order to decide which dataSource to
use, but the foreignKeyFields member variable hasn't
been initialized yet. This happens later in the
method, during the call to
initializeForeignKeyFields(). The attached file is a
proposed fix to this class. I just moved dataSource
and table name loading to after where the foreign key
fields are initialized.