Bugs item #655821, was opened at 2002-12-18 15:48
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=376685&aid=655821&group_id=22866

Category: JBossCMP
Group: None
Status: Open
Resolution: None
Priority: 5
Submitted By: Jeff Whiteside (jwhiteside)
Assigned to: Nobody/Anonymous (nobody)
Summary: bug with [ 644394 ] support for cmr+cmp 

Initial Comment:
I descovered a potential problem with patch 644394 
described in the following 
forum:http://jboss.org/forums/thread.jsp?
forum=46&thread=25017. If this is not the proper place to 
post this, please let me know.

I have successfully applied the patch but am still receiving 
a "duplicate column name". After digging through the 
patched code I noticed that the cmpFieldsByName Map on 
org.jboss.ejb.plugins.cmp.jdbc.bridge.JDBCEntityBridge 
contains field names as keys. When the 
getCMPFieldByName(cnames[ndx]) method is invoked 
within the loadUniqueCMPCMRFieldSet() method of the 
same class, an array containing column names is passed 
in. Since the Map contains field names and the argument 
contains column names, this method always returns null 
causing both the cmp and the cmr field to be added to the 
insert causing the duplicate column name.

I fixed the problem in my case by changing the 
JDBCEntityBridge.loadUniqueCMPCMRFieldSet() code 
from:

String cnames[] = cmrField.getJDBCType
().getColumnNames();
  for (int ndx = 0; ndx < cnames.length; ndx++) {
     if (getCMPFieldByName(cnames[ndx]) == null)   {
        uniqueList.add(cmrField);
      }

to:

if (getCMPFieldByName(cmrField.getFieldName()) == null) {
  uniqueList.add(cmrField);
}

Can sombody verify that this is a defect and advise me as 
to how to get the patch updated?



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

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


-------------------------------------------------------
This sf.net email is sponsored by:
With Great Power, Comes Great Responsibility 
Learn to use your power at OSDN's High Performance Computing Channel
http://hpc.devchannel.org/
_______________________________________________
Jboss-development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development

Reply via email to