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 On Sun, Nov 8, 2009 at 12:24 PM, Clint <[email protected]> wrote: > > 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 > > > --~--~---------~--~----~------------~-------~--~----~ Before posting questions to the group please read: http://groups.google.com/group/transfer-dev/web/how-to-ask-support-questions-on-transfer You received this message because you are subscribed to the Google Groups "transfer-dev" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/transfer-dev?hl=en -~----------~----~----~----~------~----~------~--~---
