Bugs item #937974, was opened at 2004-04-19 11:40
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=376685&aid=937974&group_id=22866

Category: JBossCMP
Group: None
Status: Open
Resolution: None
Priority: 5
Submitted By: David Sills (davidsills)
Assigned to: Nobody/Anonymous (nobody)
Summary: Problem reading foreign-key datasource

Initial Comment:
Windows XP Professional
JDK 1.4.2
JBoss 3.2.3 (but should be fixed in other versions as well)

If the default datasource specified in standardjbosscmp-
jdbc.xml is not deployed, foreign-key relationships throw 
an exception upon deployment (see stack trace in 
accompanying document).

Why it happens and a suggested fix:

When reading the jbosscmp-jdbc file in 
JDBCRelationMetaData, no datasource value can be 
retrieved for foreign-key relationships (since foreign-key 
is an empty tag, not having a "datasource" child), so 
the defaults in standardjbosscmp-jdbc.xml are used. The 
same is true for datasource mapping (Code excerpt 1).

A test is performed in JDBCStartCommand that tries to 
retrieve the datasource for any kind of relationship 
(Code excerpt 2).

This calls JDBCRelationMetaData. If the datasource does 
not exist (and there should not have to be a guaranteed 
DefaultDS or any other default datasource on a JBoss 
installation), JDBCRelationMetaData throws an Exception 
(Code excerpt 3).

A logical fix is to have the JDBCRelationMetaData assign 
the datasource and datasource mapping for a foreign-
key relationship from one of the entities involved in the 
relationship (which are retrievable from the 
JDBCRelationRoleMetaData) (Code excerpt 4).

Since the datasource and datasourceMapping variables 
are final, this requires that they not be assigned where 
they are currently; the current assignments should be 
removed (Code excerpt 5 and 6).

In this way, the datasource and datasource mapping 
values for foreign-key mappings will be as valid as they 
are for relation-table mappings.


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

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


-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click
_______________________________________________
JBoss-Development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development

Reply via email to