Issue with Transfer ORM - Railo 3.1.1.000 final & Transfer 1.1

22 views
Skip to first unread message

Clint

unread,
Nov 8, 2009, 4:52:15 PM11/8/09
to Railo
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?

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)
/webroot/transfer/com/dynamic/TransferPopulator.cfc (59)
/webroot/transfer/com/dynamic/DynamicManager.cfc (72)
/webroot/transfer/com/Transfer.cfc (120)

The column shFormat is configured as follows:
<property name="shFormat" type="numeric" column="shFormat" ignore-
insert="true" ignore-update="true" />
We're on SQL Server 2005.

The DB column datatype is INT.

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.

Thanks,

Clint

Sean Corfield

unread,
Nov 8, 2009, 5:55:26 PM11/8/09
to ra...@googlegroups.com
On Sun, Nov 8, 2009 at 1:52 PM, Clint <clint...@gmail.com> wrote:
> is of invalid type, can't cast String [] to a value of type [numeric]

That seems to indicate freeProduct.id is an empty string (which can't
be converted to a number)?

Certainly if it was a string containing digits, Railo would convert it.

Perhaps you could double check what freeProduct.id actually contains?
--
Sean A Corfield -- (904) 302-SEAN
Railo Technologies US -- http://getrailo.com/
An Architect's View -- http://corfield.org/

"If you're not annoying somebody, you're not really alive."
-- Margaret Atwood

Clint

unread,
Nov 8, 2009, 10:02:23 PM11/8/09
to Railo
Sean, thanks for the reply. I can confirm that freeProduct.id is a
string with the value "9649" That is obviously not a number- Adobe's
implementation does an implicit conversion (does the spec for CFML
require this?) and I assume that Railo's does as well. In fact, as a
sanity check, I just compared the string "9649" EQ 9649 and got
boolean true, so the behavior seems to be the same on the surface.

Clint

On Nov 8, 4:55 pm, Sean Corfield <seancorfi...@gmail.com> wrote:
> On Sun, Nov 8, 2009 at 1:52 PM, Clint <clintmil...@gmail.com> wrote:
> > is of invalid type, can't cast String [] to a value of type [numeric]
>
> That seems to indicate freeProduct.id is an empty string (which can't
> be converted to a number)?
>
> Certainly if it was a string containing digits, Railo would convert it.
>
> Perhaps you could double check what freeProduct.id actually contains?
> --
> Sean A Corfield -- (904) 302-SEAN
> Railo Technologies US --http://getrailo.com/
> An Architect's View --http://corfield.org/

Sean Corfield

unread,
Nov 10, 2009, 2:45:33 PM11/10/09
to ra...@googlegroups.com
Then I'm at a bit of a loss. Railo definitely converts (numeric)
string values to numeric types on demand so that isn't the problem.

As I said from the original error "can't cast String [] to a value of
type [numeric]" that looks like an empty string to me (the error shows
the string in the []) so I suspect something else is going on deep
inside Transfer that is the real root of this issue, rather than being
freeProduct.id.

I'd start looking at the code Transfer generates and go through the
stack trace file by file to see what variable is really being
converted to numeric.

hockeypfef

unread,
Nov 18, 2009, 9:09:30 AM11/18/09
to Railo
I seem to be having the same issue. Seems like it is tied to fields
that contain NULL values.

On Nov 10, 2:45 pm, Sean Corfield <seancorfi...@gmail.com> wrote:
> Then I'm at a bit of a loss. Railo definitely converts (numeric)
> string values to numeric types on demand so that isn't the problem.
>
> As I said from the original error "can't cast String [] to a value of
> type [numeric]" that looks like an empty string to me (the error shows
> the string in the []) so I suspect something else is going on deep
> insideTransferthat is the real root of this issue, rather than being
> freeProduct.id.
>
> I'd start looking at the codeTransfergenerates and go through the
> stack trace file by file to see what variable is really being
> converted to numeric.
>
Reply all
Reply to author
Forward
0 new messages