Issue with parameterized get - Railo 3.1.1.000 final & Transfer 1.1

3 views
Skip to first unread message

Clint

unread,
Nov 8, 2009, 3:24:57 PM11/8/09
to transfer-dev
I'm having issues with a simple transfer load by PK operation as
follows:

<cfset freeProduct.product = beans.transfer.get("Products.Product",
freeProduct.id) />

The freeProduct.id is a member of a struct with the primary key of the
Products.Product TO that we want to load. When Transfer tries to load
this object we get an Expression exception with the following message:

invalid call of the function setshFormat (/Users/clintmiller/Downloads/
railo-3.1.1.000-railo-express-macosx/webroot/com/worshiphousemedia/
model/data/transfer/Products.Product
$7DE02DF48635A93F7F656E8C6518F84E.transfer), first Argument (shFormat)
is of invalid type, can't cast String [] to a value of type [numeric]

Now that message seems to indicate it's a simple type mismatch- but if
you think you can solve that by wrapping the freeProduct.id in a call
to the VAL() function, you'd be wrong. (freeProduct.id is truly a
string value, but Adobe's CF engine does an implicit conversion here
and this code works fine). Is this an issue with Railo (compatibility
difference with Adobe?) or an issue with Transfer on Railo?

Thanks,

Clint

Mark Mandel

unread,
Nov 8, 2009, 3:26:38 PM11/8/09
to transf...@googlegroups.com

Clint

unread,
Nov 8, 2009, 3:30:21 PM11/8/09
to transfer-dev
Full stacktrace (stripped path leader):

/webroot/com/worshiphousemedia/model/data/transfer/Products.Product
$7DE02DF48635A93F7F656E8C6518F84E.transfer (1373)
/webroot/com/worshiphousemedia/model/data/transfer/Products.Product
$7DE02DF48635A93F7F656E8C6518F84E.transfer (1304)
/webroot/com/worshiphousemedia/model/data/transfer/
Products...@7DE02DF48635A93F7F656E8C6518F84E.transfer (937)
/webroot/transfer/com/dynamic/TransferPopulator.cfc (59)
/webroot/transfer/com/dynamic/DynamicManager.cfc (72)
/webroot/transfer/com/Transfer.cfc (120)
> E: mark.man...@gmail.com

Mark Mandel

unread,
Nov 8, 2009, 3:31:21 PM11/8/09
to transf...@googlegroups.com
How is shFormat configured, and what is its database type?

What database are you on?

Mark
--
E: mark....@gmail.com

Clint

unread,
Nov 8, 2009, 3:39:57 PM11/8/09
to transfer-dev
It's confiugred as follows:

<property name="shFormat" type="numeric" column="shFormat" ignore-
insert="true" ignore-update="true" />

We're on SQL Server 2005.

Also, the issue isn't just this one column. If I change the type to
string, Railo/Transfer doesn't freak out and the implicit conversion
will happen when SQL Server executes the query- but that relies on
specific database behavior. Other columns in the same TO will have
these same casting issues and will require changed configuration,
making me think that there's a bigger issue at stake here than just a
couple of data types on an isolated column.

On Nov 8, 2:31 pm, Mark Mandel <mark.man...@gmail.com> wrote:
> How is shFormat configured, and what is its database type?
>
> What database are you on?
>
> Mark
>
>
>
>
>
> On Mon, Nov 9, 2009 at 7:30 AM, Clint <clintmil...@gmail.com> wrote:
>
> > Full stacktrace (stripped path leader):
>
> > /webroot/com/worshiphousemedia/model/data/transfer/Products.Product
> > $7DE02DF48635A93F7F656E8C6518F84E.transfer (1373)
> > /webroot/com/worshiphousemedia/model/data/transfer/Products.Product
> > $7DE02DF48635A93F7F656E8C6518F84E.transfer (1304)
> > /webroot/com/worshiphousemedia/model/data/transfer/
> > Products.Prod...@7DE02DF48635A93F7F656E8C6518F84E.transfer (937)

Mark Mandel

unread,
Nov 8, 2009, 3:44:09 PM11/8/09
to transf...@googlegroups.com
what is the column data type?

Mark
--
E: mark....@gmail.com

Clint

unread,
Nov 8, 2009, 3:47:01 PM11/8/09
to transfer-dev
INT

Cody Caughlan

unread,
Nov 8, 2009, 5:01:54 PM11/8/09
to transf...@googlegroups.com
I had this exact same issue using Railo and Transfer. Yes, in a
nutshell Railo is a little less forgiving than Adobe CF and wont
always do the automatic type conversion. My only solution was to
always make sure that I had a nullable="true" and nullvalue="[some
appropriate value]" in my column definition.

Whats happening in your case is that field is NULL in the DB, which
translates to the empty string in CF, which is then trying to be set()
on your model which is where this error is happening. You can get
around it by specifying the default NULL value:
nullvalue="[something]". I chose to use -1 but you can use any
appropriate value for your application.

You might not still be out of the woods. I found a bug in Transfer
where it would not always use this specified nullvalue when setting
the properties. I talked about this issue here:

http://groups.google.com/group/transfer-dev/browse_thread/thread/b87d2d0ec81aad36?hl=en

My last message details the changes I had to make to Transfer to fix
this (pretty simple). The diff is at:

http://gist.github.com/229493

/Cody
Reply all
Reply to author
Forward
0 new messages