Iterating over an collection (one-to-many) within a composite class gives an error

3 views
Skip to first unread message

Philip

unread,
Jun 27, 2008, 9:15:31 AM6/27/08
to transfer-dev
Transfer version: 1.0rc a
CFML: 8.0
Dabase: MySql 5
OS: Windows 2003
----------------------------------------------------------------------------------------------------

The case
----------------------------------------------------------------------------------------------------
I have a training, a location and a contactperson. The composition of
training and location (via the composition object trainingLocation)
can have an one-to-many with contactpersons (also via a composition
trainingLocationContactperson). Every relation (training-location-
contactperson) can have extra information associated with that
relation

These are the beans (simplified for the sake of composition)
----------------------------------------------------------------------------------------------------
<objectDefinitions>
<package name="opl">
<object name="Training" table="opleiding">
<id name="Id" type="numeric" column="opleidingid"/>
<property name="name" type="string" column="naam" />
<onetomany name="TrainingLocation" lazy="true">
<link to="opl.TrainingLocation" column="opleidingid" />
<collection type="array" />
</onetomany>
</object>

<object name="Location" table="locatie">
<id name="Id" type="numeric" column="locatieID"/>
<property name="Name" type="string" column="naam" />
<onetomany name="TrainingLocation" lazy="true">
<link to="opl.TrainingLocation" column="locatieid" />
<collection type="array" />
</onetomany>
</object>

<object name="Contactperson" table="contactpersoon">
<id name="Id" type="numeric" column="contactpersoonid"/>
<property name="Name" type="string" column="naam" />
</object>

<object name="TrainingLocation" table="opleidingLocatie2">
<compositeid>
<parentonetomany class="Training"/>
<parentonetomany class="Location"/>
</compositeid>
<onetomany name="LocationContactperson" lazy="true">
<link to="opl.TrainingLocationContactperson"
column="opleidinglocatieid" />
<collection type="array" />
</onetomany>
<property name="description" type="string" column="omschrijving" />
<property name="remarks" type="string" column="bijzonderheden" />
</object>

<object name="TrainingLocationContactperson"
table="opleidingLocatieContactpersoon">
<compositeid>
<parentonetomany class="opl.TrainingLocation"/>
<manytoone name="Contactperson" />
</compositeid>
<manytoone name="Contactperson">
<link to="opl.Contactperson" column="contactpersoonid" />
</manytoone>
<property name="description" type="string" column="omschrijving" />
<property name="remarks" type="string" column="bijzonderheden" />
</object>
</package>
</objectDefinitions>


Testcode
----------------------------------------------------------------------------------------------------
<cfset training = transfer.get('opl.Training', 920) />
<cfset iterator = training.getTrainingLocationIterator()>

<cfloop condition="iterator.hasNext()">
<cfset traininglocatie = iterator.next()>
<cfset iterator2 =
traininglocatie.getLocationContactpersonIterator() >
<cfloop condition="iterator2.hasNext()">
<cfset locationContactperson = iterator2.next()>
<cfset contactperson = locationContactperson.getContactperson()>
<cfdump var="#contactperson.getMemento()#">
</cfloop>
</cfloop>



Error
----------------------------------------------------------------------------------------------------
This is the error when i try to iterate:


The key for this class should be a struct
The key for class 'opl.TrainingLocation' should be a struct

The error occurred in E:\inetpub\wwwroot\websites
\transfer_v1.0RC2\transfer\com\sql\TransferSelecter.cfc: line 920
Called from E:\inetpub\wwwroot\websites\transfer_v1.0RC2\transfer\com
\sql\AbstractBaseTransfer.cfc: line 218
Called from E:\inetpub\wwwroot\websites\transfer_v1.0RC2\transfer\com
\sql\TransferSelecter.cfc: line 51
Called from E:\inetpub\wwwroot\websites\transfer_v1.0RC2\transfer\com
\sql\SQLManager.cfc: line 87
Called from E:\inetpub\wwwroot\websites\transfer_v1.0RC2\transfer\com
\dynamic\TransferPopulator.cfc: line 100
Called from E:\inetpub\wwwroot\websites\transfer_v1.0RC2\transfer\com
\dynamic\DynamicManager.cfc: line 93
Called from E:\inetpub\wwwroot\websites\transfer_v1.0RC2\transfer\com
\Transfer.cfc: line 764
Called from E:\inetpub\wwwroot\websites\asp023mysql\site\model2\albeda
\transfer_trainingguide\opl.TrainingLocation
$437A7173FA97F2A10B3C863FF70450F2.transfer: line 124
Called from E:\inetpub\wwwroot\websites\asp023mysql\site\model2\albeda
\transfer_trainingguide\opl.TrainingLocation
$437A7173FA97F2A10B3C863FF70450F2.transfer: line 466
Called from E:\inetpub\wwwroot\websites\asp023mysql\site\mod
\oplv2\testdrive.cfm: line 29

918 : <cfargument name="message" hint="The message to accompany the
exception" type="string" required="Yes">
919 : <cfargument name="detail" type="string" hint="The detail
message for the exception" required="No" default="">
920 : <cfthrow type="#arguments.type#" message="#arguments.message#"
detail="#arguments.detail#">
921 : </cffunction>
922 :

Brian Kotek

unread,
Jun 27, 2008, 9:30:50 AM6/27/08
to transf...@googlegroups.com
Have you tried this with the latest version in SVN? Also, you probably should upgrade to CF 8.01. Lastly, have you deleted your Transfer definition files, reinitialized the application, and tried it again?

Philip

unread,
Jun 27, 2008, 10:35:01 AM6/27/08
to transfer-dev
Hi Brian,

thank you for your reply so quickly. I've just updated Coldfusion to
8.0.1, updated transfer with the latest version in svn (1.0.d),
deleted all the bean definitions and restarted the server.

When try to iterate i get the same error:

The key for this class should be a struct
The key for class 'opl.TrainingLocation' should be a struct

The error occurred in E:\inetpub\wwwroot\frameworks\transfer\transfer-
ber\com\sql\TransferSelecter.cfc: line 920
Called from E:\inetpub\wwwroot\frameworks\transfer\transfer-ber\com\sql
\AbstractBaseTransfer.cfc: line 218
Called from E:\inetpub\wwwroot\frameworks\transfer\transfer-ber\com\sql
\TransferSelecter.cfc: line 51
Called from E:\inetpub\wwwroot\frameworks\transfer\transfer-ber\com\sql
\SQLManager.cfc: line 87
Called from E:\inetpub\wwwroot\frameworks\transfer\transfer-ber\com
\dynamic\TransferPopulator.cfc: line 100
Called from E:\inetpub\wwwroot\frameworks\transfer\transfer-ber\com
\dynamic\DynamicManager.cfc: line 93
Called from E:\inetpub\wwwroot\frameworks\transfer\transfer-ber\com
\Transfer.cfc: line 764
Called from E:\inetpub\wwwroot\websites\asp023mysql\site\model2\albeda
\transfer_trainingguide\opl.TrainingLocation
$437A7173FA97F2A10B3C863FF70450F2.transfer: line 124
Called from E:\inetpub\wwwroot\websites\asp023mysql\site\model2\albeda
\transfer_trainingguide\opl.TrainingLocation
$437A7173FA97F2A10B3C863FF70450F2.transfer: line 501
Called from E:\inetpub\wwwroot\websites\asp023mysql\site\mod
\oplv2\testdrive.cfm: line 32

918 : <cfargument name="message" hint="The message to accompany the
exception" type="string" required="Yes">
919 : <cfargument name="detail" type="string" hint="The detail
message for the exception" required="No" default="">
920 : <cfthrow type="#arguments.type#" message="#arguments.message#"
detail="#arguments.detail#">
921 : </cffunction>
922 :

Is this is bug? Or did i relate the objects the wrong way? Because it
looks like it is not possible to have a compositekey composed with
another compositekey.


Kind regards,

Philip Boekholt

Brian Kotek

unread,
Jun 27, 2008, 10:52:40 AM6/27/08
to transf...@googlegroups.com
I haven't used the composite keys so I'm somewhat out of my area on this. What happens if you specify the full package path to the target object for your "class" attribute?

Philip

unread,
Jun 27, 2008, 11:02:22 AM6/27/08
to transfer-dev
You mean this?

<compositeid>
<parentonetomany class="Training"/>
<parentonetomany class="Location"/>
</compositeid>

Should be:

<compositeid>
<parentonetomany class="opl.Training"/>
<parentonetomany class="opl.Location"/>
</compositeid>

My package is called: opl. So the full package paths to the target
objects are "opl.Training" and "opl.Location". I forgot to put the
packagepath back into this post when i copy/paste/cleaned up the xml
file

Brian Kotek

unread,
Jun 27, 2008, 11:38:55 AM6/27/08
to transf...@googlegroups.com
So with the correct package paths does it work? Or is it the same? Make sure if you changed those that you reinitialize Transfer (and deleting the definitions probably wouldn't hurt either).
Message has been deleted

Philip

unread,
Jun 27, 2008, 7:34:47 PM6/27/08
to transfer-dev
The package paths are correct and i've deleted the beans and even
restarted the server. I still get the same error.

Trying to iterate over a collection of objects which have a
compositekey (class opl.TrainingLocationPerson) made of a compositekey
(class opl.TrainingLocation) and another key (class opl.Contactperson)
does not work. I guess when the iterator wants to get the next object,
it does not provide the correct key format: a structure.



On 27 jun, 17:38, "Brian Kotek" <brian...@gmail.com> wrote:
> So with the correct package paths does it work? Or is it the same? Make sure
> if you changed those that you reinitialize Transfer (and deleting the
> definitions probably wouldn't hurt either).
>

Stephen Judd

unread,
Jun 27, 2008, 7:48:58 PM6/27/08
to transf...@googlegroups.com
Can you just add ids to those two tables and forget about the composite keys?

Steve

Philip

unread,
Jun 28, 2008, 7:56:26 AM6/28/08
to transfer-dev
Sure, i can redesign the databaseschema by adding extra id's and
everything should work fine. I just wanted to point out that the
framework gives you the opportunity to do so, but that this scenario
doesn't work (yet). Also, from the EER point of view it is a bit
unnecessary to have another key while you can have an unique key by
composition.


On 28 jun, 01:48, "Stephen Judd" <judd.step...@gmail.com> wrote:
> Can you just add ids to those two tables and forget about the composite
> keys?
>
> Steve
>

Mark Mandel

unread,
Jun 28, 2008, 8:51:31 PM6/28/08
to transf...@googlegroups.com
Philip,

Sounds like a bug in the lazy load mechanism on objects with composite keys, shouldn't be too hard a fix.

For a workaround, does it work if you just turn off the lazy load?

Mark
--
E: mark....@gmail.com
W: www.compoundtheory.com

Philip

unread,
Jul 1, 2008, 5:06:41 AM7/1/08
to transfer-dev
Hi mark,

Unfortunately, i cannot turn off lazy load because of the following:

All of the parent oneToMany declared in a 'compositeid' declaration'
must be lazy='true'
The operation you have tried to execute would have caused corrupt
data, or an infinite loop. In object
'opl.TrainingLocationContactperson' the oneToMany
'LocationContactperson' on object 'opl.TrainingLocation' are
lazy='false', when it must be lazy='true'

For now, I'll add an extra key.
> E: mark.man...@gmail.com
> W:www.compoundtheory.com

Mark Mandel

unread,
Jul 1, 2008, 6:46:23 PM7/1/08
to transf...@googlegroups.com
Fair enough.

I haven't had a chance to reproduce the bug yet, so there is no ticket. I'm in the middle of finishing off some functionality for Transfer, but when its done, i'll look into this bug.

Mark

Mark Mandel

unread,
Jul 6, 2008, 8:29:09 PM7/6/08
to transf...@googlegroups.com

Mark Mandel

unread,
Jul 7, 2008, 2:44:42 AM7/7/08
to transf...@googlegroups.com
Phillip,

I just committed a fix for this.

If you get a chance, please grab the SVN version, and have a test, to
make sure it solves your problem, and I will close the ticket.

Mark

Philip

unread,
Jul 8, 2008, 6:48:02 AM7/8/08
to transfer-dev
Hi Mark,

i will test the fix this evening at home. Unfortunately, i didn't had
the time to wait for a fix for the current project i'm working on. So
i'll stick with the workaround. I'll keep you informed.

Thanks for the fix.

Philip



On 7 jul, 08:44, "Mark Mandel" <mark.man...@gmail.com> wrote:
> Phillip,
>
> I just committed a fix for this.
>
> If you get a chance, please grab the SVN version, and have a test, to
> make sure it solves your problem, and I will close the ticket.
>
> Mark
>
>
>
> On Mon, Jul 7, 2008 at 10:29 AM, Mark Mandel <mark.man...@gmail.com> wrote:
> > Finally got time to reproduce this.
>
> > Logged:
> >http://tracker.transfer-orm.com/issue.cfm?p=89977683-A728-9CD3-ABD954...
>
> > On Wed, Jul 2, 2008 at 8:46 AM, Mark Mandel <mark.man...@gmail.com> wrote:
> >> Fair enough.
>
> >> I haven't had a chance to reproduce the bug yet, so there is no ticket. I'm
> >> in the middle of finishing off some functionality for Transfer, but when its
> >> done, i'll look into this bug.
>
> >> Mark
>
> E: mark.man...@gmail.com
> W:www.compoundtheory.com

Philip

unread,
Jul 8, 2008, 8:04:34 PM7/8/08
to transfer-dev
Mark,

it doesn't work. I get a stack overflow..

Mark Mandel

unread,
Jul 8, 2008, 8:05:59 PM7/8/08
to transf...@googlegroups.com
Philip,

I need more details than that.

What's your config, the error message, etc?

http://groups.google.com/group/transfer-dev/web/how-to-ask-support-questions-on-transfer

Mark

--
E: mark....@gmail.com
W: www.compoundtheory.com

Philip

unread,
Jul 9, 2008, 6:45:58 PM7/9/08
to transfer-dev
Sorry mark, i was away from computer...

This is my config:

<package name="trainingguide">
<object name="training" table="training"
decorator="model2.albeda.trainingguide.training.trainingStateDecorator">
<id name="Id" type="numeric" column="trainingid"/>
<property name="name" type="string" column="name" />
<onetomany name="traininglocation" lazy="true">
<link to="trainingguide.traininglocation" column="trainingid" />
<collection type="array" />
</onetomany>
</object>

<object name="traininglocation" table="traininglocation">
<id name="id" type="numeric" column="traininglocationid"/>
<manytoone name="location">
<link to="trainingguide.location" column="locationid" />
</manytoone>
<onetomany name="locationcontactperson" lazy="true">
<link to="trainingguide.traininglocationcontactperson"
column="traininglocationid" />
<collection type="array" />
</onetomany>
<property name="description" type="string" column="description" />
</object>

<object name="traininglocationcontactperson"
table="opleidinglocationcontactperson">
<compositeid>
<parentonetomany class="trainingguide.traininglocation" />
<manytoone name="contactperson" />
</compositeid>
<manytoone name="contactperson">
<link to="trainingguide.contactperson" column="contactpersonid" /
>
</manytoone>
<property name="description" type="string" column="description" />
</object>

<object name="location" table="location">
<id name="Id" type="numeric" column="locationid"/>
<property name="Name" type="string" column="name" />
<onetomany name="traininglocation" lazy="true">
<link to="trainingguide.traininglocation" column="locationid" />
<collection type="array" />
</onetomany>
</object>

<object name="contactperson" table="contactperson">
<id name="Id" type="numeric" column="contactpersonid"/>
<property name="Name" type="string" column="name" />
</object>
</package>


And this is the error:

Element compositeid is undefined in a CFML structure referenced as
part of an expression.

The error occurred in F:\inetpub\wwwroot\websites\transfer_ber\com
\TransferObject.cfc: line 134
Called from F:\inetpub\wwwroot\websites\asp023mysql\site\model2\albeda
\transfer_trainingguide\trainingguide.training
$C3E1A93B7E71D622F9CCF7D1F6D1968D.transfer: line 164
Called from F:\inetpub\wwwroot\websites\asp023mysql\site\model2\albeda
\transfer_trainingguide
\traininggui...@C3E1A93B7E71D622F9CCF7D1F6D1968D.transfer:
line 89
Called from F:\inetpub\wwwroot\websites\transfer_ber\com\dynamic
\MethodInvoker.cfc: line 47
Called from F:\inetpub\wwwroot\websites\transfer_ber\com\dynamic
\TransferPopulator.cfc: line 113
Called from F:\inetpub\wwwroot\websites\transfer_ber\com\dynamic
\DynamicManager.cfc: line 93
Called from F:\inetpub\wwwroot\websites\transfer_ber\com\Transfer.cfc:
line 764
Called from F:\inetpub\wwwroot\websites\asp023mysql\site\model2\albeda
\transfer_trainingguide\trainingguide.training
$C3E1A93B7E71D622F9CCF7D1F6D1968D.transfer: line 105
Called from F:\inetpub\wwwroot\websites\asp023mysql\site\model2\albeda
\transfer_trainingguide\trainingguide.training
$C3E1A93B7E71D622F9CCF7D1F6D1968D.transfer: line 288
Called from F:\inetpub\wwwroot\websites\asp023mysql\site\model2\albeda
\transfer_trainingguide
\traininggui...@C3E1A93B7E71D622F9CCF7D1F6D1968D.transfer:
line 8
Called from F:\inetpub\wwwroot\websites\asp023mysql\site\mod
\oplv2\testdrive.cfm: line 26
Called from F:\inetpub\wwwroot\websites\asp023mysql\site\mod
\oplv2\testdrive.cfm: line 1

132 : <cfscript>
133 : var transfer = 0;
134 : var key = arguments.memento[arguments.primaryKey];
135 : var rationalKey = 0;
136 :

Resources:

* Check the ColdFusion documentation to verify that you are using
the correct syntax.
* Search the Knowledge Base to find a solution to your problem.

Browser Mozilla/5.0 (Windows; U; Windows NT 5.1; nl; rv:1.9) Gecko/
2008052906 Firefox/3.0
Remote Address 127.0.0.1
Referrer
Date/Time 10-Jul-08 12:38 AM
Stack Trace
at cfTransferObject2ecfc817840764$funcGETCOMPOSITE.runFunction(F:
\inetpub\wwwroot\websites\transfer_ber\com\TransferObject.cfc:134) at
cftrainingguide2etraining
$C3E1A93B7E71D622F9CCF7D1F6D1968D2etransfer843694916$funcSETTRAININGLOCATIONMEMENTO.runFunction(F:
\inetpub\wwwroot\websites\asp023mysql\site\model2\albeda
\transfer_trainingguide\trainingguide.training
$C3E1A93B7E71D622F9CCF7D1F6D1968D.transfer:164) at
cftrainingguide2etraining40C3E1A93B7E71D622F9CCF7D1F6D1968D2etransfer25047976$funcSETTRAININGLOCATIONMEMENTO.runFunction(F:
\inetpub\wwwroot\websites\asp023mysql\site\model2\albeda
\transfer_trainingguide
\traininggui...@C3E1A93B7E71D622F9CCF7D1F6D1968D.transfer:89)
at cfMethodInvoker2ecfc1795649142$funcINVOKEMETHOD.runFunction(F:
\inetpub\wwwroot\websites\transfer_ber\com\dynamic\MethodInvoker.cfc:
47) at
cfTransferPopulator2ecfc900058748$funcPOPULATEONETOMANY.runFunction(F:
\inetpub\wwwroot\websites\transfer_ber\com\dynamic
\TransferPopulator.cfc:113) at
cfDynamicManager2ecfc2048609250$funcPOPULATEONETOMANY.runFunction(F:
\inetpub\wwwroot\websites\transfer_ber\com\dynamic\DynamicManager.cfc:
93) at cfTransfer2ecfc397562749$funcLOADONETOMANY.runFunction(F:
\inetpub\wwwroot\websites\transfer_ber\com\Transfer.cfc:764) at
cftrainingguide2etraining
$C3E1A93B7E71D622F9CCF7D1F6D1968D2etransfer843694916$funcLOADTRAININGLOCATION.runFunction(F:
\inetpub\wwwroot\websites\asp023mysql\site\model2\albeda
\transfer_trainingguide\trainingguide.training
$C3E1A93B7E71D622F9CCF7D1F6D1968D.transfer:105) at
cftrainingguide2etraining
$C3E1A93B7E71D622F9CCF7D1F6D1968D2etransfer843694916$funcGETTRAININGLOCATIONITERATOR.runFunction(F:
\inetpub\wwwroot\websites\asp023mysql\site\model2\albeda
\transfer_trainingguide\trainingguide.training
$C3E1A93B7E71D622F9CCF7D1F6D1968D.transfer:288) at
cftrainingguide2etraining40C3E1A93B7E71D622F9CCF7D1F6D1968D2etransfer25047976$funcGETTRAININGLOCATIONITERATOR.runFunction(F:
\inetpub\wwwroot\websites\asp023mysql\site\model2\albeda
\transfer_trainingguide
\traininggui...@C3E1A93B7E71D622F9CCF7D1F6D1968D.transfer:8)
at cftestdrive2ecfm575732205._factor2(F:\inetpub\wwwroot\websites
\asp023mysql\site\mod\oplv2\testdrive.cfm:26) at
cftestdrive2ecfm575732205.runPage(F:\inetpub\wwwroot\websites
\asp023mysql\site\mod\oplv2\testdrive.cfm:1)

coldfusion.runtime.UndefinedElementException: Element compositeid is
undefined in a CFML structure referenced as part of an expression.
at coldfusion.runtime.CfJspPage.ArrayGetAt(CfJspPage.java:919)
at coldfusion.runtime.CfJspPage._arrayGetAt(CfJspPage.java:930)
at coldfusion.runtime.CfJspPage._arrayGetAt(CfJspPage.java:925)
at cfTransferObject2ecfc817840764$funcGETCOMPOSITE.runFunction(F:
\inetpub\wwwroot\websites\transfer_ber\com\TransferObject.cfc:134)
at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:418)
at coldfusion.filter.SilentFilter.invoke(SilentFilter.java:47)
at coldfusion.runtime.UDFMethod
$ReturnTypeFilter.invoke(UDFMethod.java:360)
at coldfusion.runtime.UDFMethod
$ArgumentCollectionFilter.invoke(UDFMethod.java:324)
at
coldfusion.filter.FunctionAccessFilter.invoke(FunctionAccessFilter.java:
59)
at coldfusion.runtime.UDFMethod.runFilterChain(UDFMethod.java:277)
at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:192)
at coldfusion.runtime.CfJspPage._invokeUDF(CfJspPage.java:2471)
at cftrainingguide2etraining
$C3E1A93B7E71D622F9CCF7D1F6D1968D2etransfer843694916$funcSETTRAININGLOCATIONMEMENTO.runFunction(F:
\inetpub\wwwroot\websites\asp023mysql\site\model2\albeda
\transfer_trainingguide\trainingguide.training
$C3E1A93B7E71D622F9CCF7D1F6D1968D.transfer:164)
at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:418)
at coldfusion.filter.SilentFilter.invoke(SilentFilter.java:47)
at coldfusion.runtime.UDFMethod
$ReturnTypeFilter.invoke(UDFMethod.java:360)
at coldfusion.runtime.UDFMethod
$ArgumentCollectionFilter.invoke(UDFMethod.java:324)
at
coldfusion.filter.FunctionAccessFilter.invoke(FunctionAccessFilter.java:
59)
at coldfusion.runtime.UDFMethod.runFilterChain(UDFMethod.java:277)
at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:463)
at coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:453)
at coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:320)
at coldfusion.runtime.CfJspPage._invoke(CfJspPage.java:2222)
at
cftrainingguide2etraining40C3E1A93B7E71D622F9CCF7D1F6D1968D2etransfer25047976$funcSETTRAININGLOCATIONMEMENTO.runFunction(F:
\inetpub\wwwroot\websites\asp023mysql\site\model2\albeda
\transfer_trainingguide
\traininggui...@C3E1A93B7E71D622F9CCF7D1F6D1968D.transfer:89)
at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:418)
at coldfusion.filter.SilentFilter.invoke(SilentFilter.java:47)
at coldfusion.runtime.UDFMethod
$ReturnTypeFilter.invoke(UDFMethod.java:360)
at coldfusion.runtime.UDFMethod
$ArgumentCollectionFilter.invoke(UDFMethod.java:324)
at
coldfusion.filter.FunctionAccessFilter.invoke(FunctionAccessFilter.java:
59)
at coldfusion.runtime.UDFMethod.runFilterChain(UDFMethod.java:277)
at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:463)
at coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:453)
at coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:320)
at coldfusion.runtime.CfJspPage._invoke(CfJspPage.java:2222)
at coldfusion.tagext.lang.InvokeTag.doEndTag(InvokeTag.java:362)
at coldfusion.runtime.CfJspPage._emptyTcfTag(CfJspPage.java:2662)
at cfMethodInvoker2ecfc1795649142$funcINVOKEMETHOD.runFunction(F:
\inetpub\wwwroot\websites\transfer_ber\com\dynamic\MethodInvoker.cfc:
47)
at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:418)
at coldfusion.filter.SilentFilter.invoke(SilentFilter.java:47)
at coldfusion.runtime.UDFMethod
$ReturnTypeFilter.invoke(UDFMethod.java:360)
at coldfusion.runtime.UDFMethod
$ArgumentCollectionFilter.invoke(UDFMethod.java:324)
at
coldfusion.filter.FunctionAccessFilter.invoke(FunctionAccessFilter.java:
59)
at coldfusion.runtime.UDFMethod.runFilterChain(UDFMethod.java:277)
at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:192)
at coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:448)
at coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:308)
at coldfusion.runtime.CfJspPage._invoke(CfJspPage.java:2272)
at
cfTransferPopulator2ecfc900058748$funcPOPULATEONETOMANY.runFunction(F:
\inetpub\wwwroot\websites\transfer_ber\com\dynamic
\TransferPopulator.cfc:113)
at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:418)
at coldfusion.filter.SilentFilter.invoke(SilentFilter.java:47)
at coldfusion.runtime.UDFMethod
$ReturnTypeFilter.invoke(UDFMethod.java:360)
at coldfusion.runtime.UDFMethod
$ArgumentCollectionFilter.invoke(UDFMethod.java:324)
at
coldfusion.filter.FunctionAccessFilter.invoke(FunctionAccessFilter.java:
59)
at coldfusion.runtime.UDFMethod.runFilterChain(UDFMethod.java:277)
at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:192)
at coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:448)
at coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:308)
at coldfusion.runtime.CfJspPage._invoke(CfJspPage.java:2272)
at
cfDynamicManager2ecfc2048609250$funcPOPULATEONETOMANY.runFunction(F:
\inetpub\wwwroot\websites\transfer_ber\com\dynamic\DynamicManager.cfc:
93)
at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:418)
at coldfusion.filter.SilentFilter.invoke(SilentFilter.java:47)
at coldfusion.runtime.UDFMethod
$ReturnTypeFilter.invoke(UDFMethod.java:360)
at coldfusion.runtime.UDFMethod
$ArgumentCollectionFilter.invoke(UDFMethod.java:324)
at
coldfusion.filter.FunctionAccessFilter.invoke(FunctionAccessFilter.java:
59)
at coldfusion.runtime.UDFMethod.runFilterChain(UDFMethod.java:277)
at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:192)
at coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:448)
at coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:308)
at coldfusion.runtime.CfJspPage._invoke(CfJspPage.java:2272)
at cfTransfer2ecfc397562749$funcLOADONETOMANY.runFunction(F:\inetpub
\wwwroot\websites\transfer_ber\com\Transfer.cfc:764)
at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:418)
at coldfusion.filter.SilentFilter.invoke(SilentFilter.java:47)
at coldfusion.runtime.UDFMethod
$ReturnTypeFilter.invoke(UDFMethod.java:360)
at coldfusion.runtime.UDFMethod
$ArgumentCollectionFilter.invoke(UDFMethod.java:324)
at
coldfusion.filter.FunctionAccessFilter.invoke(FunctionAccessFilter.java:
59)
at coldfusion.runtime.UDFMethod.runFilterChain(UDFMethod.java:277)
at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:192)
at coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:448)
at coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:308)
at coldfusion.runtime.CfJspPage._invoke(CfJspPage.java:2272)
at cftrainingguide2etraining
$C3E1A93B7E71D622F9CCF7D1F6D1968D2etransfer843694916$funcLOADTRAININGLOCATION.runFunction(F:
\inetpub\wwwroot\websites\asp023mysql\site\model2\albeda
\transfer_trainingguide\trainingguide.training
$C3E1A93B7E71D622F9CCF7D1F6D1968D.transfer:105)
at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:418)
at coldfusion.filter.SilentFilter.invoke(SilentFilter.java:47)
at coldfusion.runtime.UDFMethod
$ReturnTypeFilter.invoke(UDFMethod.java:360)
at coldfusion.runtime.UDFMethod
$ArgumentCollectionFilter.invoke(UDFMethod.java:324)
at
coldfusion.filter.FunctionAccessFilter.invoke(FunctionAccessFilter.java:
59)
at coldfusion.runtime.UDFMethod.runFilterChain(UDFMethod.java:277)
at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:192)
at coldfusion.runtime.CfJspPage._invokeUDF(CfJspPage.java:2471)
at cftrainingguide2etraining
$C3E1A93B7E71D622F9CCF7D1F6D1968D2etransfer843694916$funcGETTRAININGLOCATIONITERATOR.runFunction(F:
\inetpub\wwwroot\websites\asp023mysql\site\model2\albeda
\transfer_trainingguide\trainingguide.training
$C3E1A93B7E71D622F9CCF7D1F6D1968D.transfer:288)
at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:418)
at coldfusion.filter.SilentFilter.invoke(SilentFilter.java:47)
at coldfusion.runtime.UDFMethod
$ReturnTypeFilter.invoke(UDFMethod.java:360)
at coldfusion.runtime.UDFMethod
$ArgumentCollectionFilter.invoke(UDFMethod.java:324)
at
coldfusion.filter.FunctionAccessFilter.invoke(FunctionAccessFilter.java:
59)
at coldfusion.runtime.UDFMethod.runFilterChain(UDFMethod.java:277)
at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:463)
at coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:453)
at coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:320)
at coldfusion.runtime.CfJspPage._invoke(CfJspPage.java:2222)
at
cftrainingguide2etraining40C3E1A93B7E71D622F9CCF7D1F6D1968D2etransfer25047976$funcGETTRAININGLOCATIONITERATOR.runFunction(F:
\inetpub\wwwroot\websites\asp023mysql\site\model2\albeda
\transfer_trainingguide
\traininggui...@C3E1A93B7E71D622F9CCF7D1F6D1968D.transfer:8)
at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:418)
at coldfusion.filter.SilentFilter.invoke(SilentFilter.java:47)
at coldfusion.runtime.UDFMethod
$ReturnTypeFilter.invoke(UDFMethod.java:360)
at coldfusion.runtime.UDFMethod
$ArgumentCollectionFilter.invoke(UDFMethod.java:324)
at
coldfusion.filter.FunctionAccessFilter.invoke(FunctionAccessFilter.java:
59)
at coldfusion.runtime.UDFMethod.runFilterChain(UDFMethod.java:277)
at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:192)
at coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:448)
at coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:308)
at coldfusion.runtime.CfJspPage._invoke(CfJspPage.java:2272)
at cftestdrive2ecfm575732205._factor2(F:\inetpub\wwwroot\websites
\asp023mysql\site\mod\oplv2\testdrive.cfm:26)
at cftestdrive2ecfm575732205.runPage(F:\inetpub\wwwroot\websites
\asp023mysql\site\mod\oplv2\testdrive.cfm:1)
at coldfusion.runtime.CfJspPage.invoke(CfJspPage.java:196)
at coldfusion.tagext.lang.IncludeTag.doStartTag(IncludeTag.java:370)
at coldfusion.filter.CfincludeFilter.invoke(CfincludeFilter.java:65)
at coldfusion.filter.ApplicationFilter.invoke(ApplicationFilter.java:
279)
at
coldfusion.filter.RequestMonitorFilter.invoke(RequestMonitorFilter.java:
48)
at coldfusion.filter.MonitoringFilter.invoke(MonitoringFilter.java:
40)
at coldfusion.filter.PathFilter.invoke(PathFilter.java:86)
at coldfusion.filter.ExceptionFilter.invoke(ExceptionFilter.java:70)
at
coldfusion.filter.ClientScopePersistenceFilter.invoke(ClientScopePersistenceFilter.java:
28)
at coldfusion.filter.BrowserFilter.invoke(BrowserFilter.java:38)
at coldfusion.filter.NoCacheFilter.invoke(NoCacheFilter.java:46)
at coldfusion.filter.GlobalsFilter.invoke(GlobalsFilter.java:38)
at coldfusion.filter.DatasourceFilter.invoke(DatasourceFilter.java:
22)
at coldfusion.CfmServlet.service(CfmServlet.java:175)
at
coldfusion.bootstrap.BootstrapServlet.service(BootstrapServlet.java:
89)
at jrun.servlet.FilterChain.doFilter(FilterChain.java:86)
at
coldfusion.monitor.event.MonitoringServletFilter.doFilter(MonitoringServletFilter.java:
42)
at coldfusion.bootstrap.BootstrapFilter.doFilter(BootstrapFilter.java:
46)
at jrun.servlet.FilterChain.doFilter(FilterChain.java:94)
at jrun.servlet.FilterChain.service(FilterChain.java:101)
at jrun.servlet.ServletInvoker.invoke(ServletInvoker.java:106)
at jrun.servlet.JRunInvokerChain.invokeNext(JRunInvokerChain.java:42)
at
jrun.servlet.JRunRequestDispatcher.invoke(JRunRequestDispatcher.java:
286)
at
jrun.servlet.ServletEngineService.dispatch(ServletEngineService.java:
543)
at
jrun.servlet.jrpp.JRunProxyService.invokeRunnable(JRunProxyService.java:
203)
at jrunx.scheduler.ThreadPool
$DownstreamMetrics.invokeRunnable(ThreadPool.java:320)
at jrunx.scheduler.ThreadPool
$ThreadThrottle.invokeRunnable(ThreadPool.java:428)
at jrunx.scheduler.ThreadPool
$UpstreamMetrics.invokeRunnable(ThreadPool.java:266)
at jrunx.scheduler.WorkerThread.run(WorkerThread.java:66)

I hope this helps


On 9 jul, 02:05, "Mark Mandel" <mark.man...@gmail.com> wrote:
> Philip,
>
> I need more details than that.
>
> What's your config, the error message, etc?
>
> http://groups.google.com/group/transfer-dev/web/how-to-ask-support-qu...
> E: mark.man...@gmail.com
> W:www.compoundtheory.com

Mark Mandel

unread,
Jul 9, 2008, 6:51:20 PM7/9/08
to transf...@googlegroups.com
What's the contents of testdrive.cfm?

Mark

--
E: mark....@gmail.com
W: www.compoundtheory.com

Mark Mandel

unread,
Jul 9, 2008, 7:58:12 PM7/9/08
to transf...@googlegroups.com
Philip, I just wrote this unit test, and I can't get it to fail:

Config (I took out the location, as it didn't seem relevent)

<package name="trainingguide">

<object name="training" table="tbl_a">
<id name="Id" type="UUID" column="a_id" generate="true"/>
<property name="name" type="string" column="a_value" />


<onetomany name="traininglocation" lazy="true">

<link to="trainingguide.traininglocation" column="lnkid" />


<collection type="array" />
</onetomany>
</object>

<object name="traininglocation" table="tbl_b">
<id name="id" type="UUID" column="b_id" generate="true"/>

<onetomany name="locationcontactperson" lazy="true">

<link to="trainingguide.traininglocationcontactperson" column="lnkid" />


<collection type="array" />
</onetomany>

<property name="description" type="string" column="b_value" />
</object>

<object name="traininglocationcontactperson" table="tbl_c">


<compositeid>
<parentonetomany class="trainingguide.traininglocation" />
<manytoone name="contactperson" />
</compositeid>
<manytoone name="contactperson">

<link to="trainingguide.contactperson" column="lnkid2" />
</manytoone>
<property name="id" type="UUID" column="c_id"/>
<property name="description" type="string" column="c_value" />
</object>

<object name="contactperson" table="tbl_d">
<id name="Id" type="UUID" column="d_id" generate="true"/>
<property name="Name" type="string" column="d_value" />
</object>
</package>

Unit Test:

<cffunction name="testTrainingGuide" hint="" access="public"
returntype="string" output="false">
<cfscript>
var training = getTransferD().new("trainingguide.training");
var traininglocation = getTransferD().new("trainingguide.traininglocation");
var contactperson = getTransferD().new("trainingguide.contactperson");
var traininglocationcontactperson =
getTransferD().new("trainingguide.traininglocationcontactperson");
var reget = 0;

traininglocation.setParentTraining(training);

traininglocationcontactperson.setParentTrainingLocation(traininglocation);
traininglocationcontactperson.setContactPerson(contactPerson);

getTransferD().cascadeSave(training);

getTransferD().discardAll();

reget = getTransferD().get("trainingguide.training", training.getID());

AssertTrue(reget.getIsPersisted(), "should be persisted");

AssertEquals("should be 1 child (1)", 1,
ArrayLen(reget.getTrainingLocationArray()));

reget = reget.getTrainingLocation(1);

AssertEquals("should be 1 child (2)", 1,
ArrayLen(reget.getlocationcontactpersonArray()));

AssertEquals("should be the same id", contactperson.getID()
,reget.getlocationcontactperson(1).getContactPerson().getID());
</cfscript>
</cffunction>

Should I be doing this differently?

Mark

On Thu, Jul 10, 2008 at 8:51 AM, Mark Mandel <mark....@gmail.com> wrote:
> What's the contents of testdrive.cfm?
>
> Mark
>

--
E: mark....@gmail.com
W: www.compoundtheory.com

Philip

unread,
Jul 10, 2008, 5:40:13 AM7/10/08
to transfer-dev
Hi mark,

assembling a new trainingobject with all the childs gives me no error.

But when i want retrieve a trainingobject and i want to iterate over
the childs, it gives me an error.

This is how i tested it:

<cfset training = transfer.get('trainingguide.training', 395) />

<cfset iterator = training.getTrainingLocationIterator()>

<cfloop condition="iterator.hasNext()">
<cfset traininglocatie = iterator.next()>
<cfset iterator2 =
traininglocatie.getLocationContactpersonIterator() >

<cfloop condition="iterator2.hasNext()">
<cfset LocationContactperson = iterator2.next()>
<cfset contactperson = LocationContactperson.getContactperson()>
<cfdump var="#contactperson.getMemento()#">
</cfloop>
</cfloop>

> On Thu, Jul 10, 2008 at 8:51 AM, Mark Mandel <mark.man...@gmail.com> wrote:
> > What's the contents of testdrive.cfm?
>
> > Mark
>
> --
> E: mark.man...@gmail.com
> W:www.compoundtheory.com

Mark Mandel

unread,
Jul 10, 2008, 7:57:33 AM7/10/08
to transf...@googlegroups.com
Philip,

That is what I seem to be doing in my unit test. You can see I
discardAll() and then re-retrieve the object, as new.

If you remove the manytoone to location, as I did, does that make any
difference? (I expect you will still get the error).

Did you delete your .transfer files after you upgraded? Looking at
the error you got, it seems like there may have been a mismatch
somewhere?

Are you sure your compositeid values are actually unique?

Can you

--
E: mark....@gmail.com
W: www.compoundtheory.com

Mark Mandel

unread,
Jul 10, 2008, 7:58:41 AM7/10/08
to transf...@googlegroups.com
Whoops. hit send before I was done.

Final stupid question - I assume you upgraded from what was in SVN?

What revision number are you at?

Mark

Philip

unread,
Jul 10, 2008, 9:05:05 AM7/10/08
to transfer-dev
Hi mark,

I tried it with revision 535 and with revision 526 (when you committed
the fix).


my dbschema is this:

table user
----------------------------------------
userid (pk, autoincrement)
name

table contactperson
----------------------------------------
contactpersonid (pk, autoincrement)
name

table location
----------------------------------------
locationid (pk, autoincrement)
name

table traininglocation
----------------------------------------
traininglocationid (pk, autoincrement.)

(I couldn't use a compositeKey here because when i wanted to use a one-
to-many inside object traininglocation i could only set 1 column, not
2 columns trainingid and locationid so i had to combine these 2
columns with an auto inc. traininglocationID)

trainingid (fk, references to column trainingid of table training)
locationid (fk, references to column locationid of table location)
description

table traininglocationcontactperson
----------------------------------------
traininglocationid (composite pk, references to column
traininglocationid of table traininglocation)
contactpersonid (composite pk, references to column contactpersonid of
table contactperson)
description






On 10 jul, 13:58, "Mark Mandel" <mark.man...@gmail.com> wrote:
> Whoops. hit send before I was done.
>
> Final stupid question - I assume you upgraded from what was in SVN?
>
> What revision number are you at?
>
> Mark
>
>
>
> On Thu, Jul 10, 2008 at 9:57 PM, Mark Mandel <mark.man...@gmail.com> wrote:
> > Philip,
>
> > That is what I seem to be doing in my unit test.  You can see I
> > discardAll() and then re-retrieve the object, as new.
>
> > If you remove the manytoone to location, as I did, does that make any
> > difference? (I expect you will still get the error).
>
> > Did you delete your .transfer files after you upgraded?  Looking at
> > the error you got, it seems like there may have been a mismatch
> > somewhere?
>
> > Are you sure your compositeid values are actually unique?
>
> > Can you
>
> E: mark.man...@gmail.com
> W:www.compoundtheory.com

Philip

unread,
Jul 10, 2008, 9:15:15 AM7/10/08
to transfer-dev
OW NO! It does work now! I mean OW YEAH! What did I do? Or what did
YOU do? ;)

It works now with reivision 535 :) I'm going to use this setup for
other projects. Thanks!

But i got another question about compositeID's

Initially, i had this dbschema:

training
*trainingID
*name

contactperson
*contactpersonid
*name

location
*locationid
*name

traininglocation
*trainingid (composite pk)
*locationid (composite pk)
*comments

traininglocationcontactperson
*trainingid (composite pk)
*locationid (composite pk)
*contactpersonid (composite pk)
*comments

How can i pass in the columns of the compositeID in a oneToMany
relation:

<object name="traininglocation" table="traininglocation">
<compositeid>
<parentonetomany class="trainingguide.training" />
<parentonetomany class="trainingguide.location" />
</compositeid>

<onetomany name="locationcontactperson" lazy="true">
<link to="trainingguide.traininglocationcontactperson"
column="??????????????????????????????" />
<collection type="array" />
</onetomany>
<property name="comments" type="string" column="comments" />
</object>

<object name="traininglocationcontactperson"
table="traininglocationcontactperson">
<compositeid>
<parentonetomany class="trainingguide.traininglocation" />
<manytoone name="contactperson" />
</compositeid>
<manytoone name="contactperson">
<link to="trainingguide.contactperson" column="contactpersonid" />
</manytoone>
<property name="comments" type="string" column="comments" />
</object>








On 10 jul, 13:58, "Mark Mandel" <mark.man...@gmail.com> wrote:
> Whoops. hit send before I was done.
>
> Final stupid question - I assume you upgraded from what was in SVN?
>
> What revision number are you at?
>
> Mark
>
>
>
> On Thu, Jul 10, 2008 at 9:57 PM, Mark Mandel <mark.man...@gmail.com> wrote:
> > Philip,
>
> > That is what I seem to be doing in my unit test.  You can see I
> > discardAll() and then re-retrieve the object, as new.
>
> > If you remove the manytoone to location, as I did, does that make any
> > difference? (I expect you will still get the error).
>
> > Did you delete your .transfer files after you upgraded?  Looking at
> > the error you got, it seems like there may have been a mismatch
> > somewhere?
>
> > Are you sure your compositeid values are actually unique?
>
> > Can you
>
> E: mark.man...@gmail.com
> W:www.compoundtheory.com

Mark Mandel

unread,
Jul 11, 2008, 2:11:54 AM7/11/08
to transf...@googlegroups.com
Relationships can only go from FK->PK.

It's one of the limitations of the system.

If you need a relationship b/w the two, sounds like you need the
object to have a primary key.

Mark

--
E: mark....@gmail.com
W: www.compoundtheory.com

Reply all
Reply to author
Forward
0 new messages