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

Category: JBossCMP
Group: v3.2
>Status: Closed
>Resolution: Fixed
Priority: 5
Submitted By: David Sills (davidsills)
Assigned to: Alexey Loubyansky (loubyansky)
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.


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

>Comment By: Alexey Loubyansky (loubyansky)
Date: 2004-08-08 18:05

Message:
Logged In: YES 
user_id=543482

This was fixed. Thanks.

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

Comment By: Alexey Loubyansky (loubyansky)
Date: 2004-04-19 19:02

Message:
Logged In: YES 
user_id=543482

Agreed.


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

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 OSTG. Have you noticed the changes on
Linux.com, ITManagersJournal and NewsForge in the past few weeks? Now,
one more big change to announce. We are now OSTG- Open Source Technology
Group. Come see the changes on the new OSTG site. www.ostg.com
_______________________________________________
JBoss-Development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development

Reply via email to