Bugs item #1068206, was opened at 2004-11-17 21:27
Message generated for change (Settings changed) made by loubyansky
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=376685&aid=1068206&group_id=22866

Category: JBossCMP
Group: v3.2
Status: Open
Resolution: None
Priority: 5
Submitted By: Brad Geddes (bgeddes)
>Assigned to: Alexey Loubyansky (loubyansky)
Summary: Incorrect data source used loading relationship field

Initial Comment:
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.

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=376685&aid=1068206&group_id=22866


-------------------------------------------------------
This SF.Net email is sponsored by: InterSystems CACHE
FREE OODBMS DOWNLOAD - A multidimensional database that combines
robust object and relational technologies, making it a perfect match
for Java, C++,COM, XML, ODBC and JDBC. www.intersystems.com/match8
_______________________________________________
JBoss-Development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development

Reply via email to