• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Mysql and pk fetches with EOUtil or ERXEOControlUtil. Adaptor bug?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Mysql and pk fetches with EOUtil or ERXEOControlUtil. Adaptor bug?


  • Subject: Re: Mysql and pk fetches with EOUtil or ERXEOControlUtil. Adaptor bug?
  • From: William Hatch <email@hidden>
  • Date: Thu, 18 Sep 2008 16:06:26 -0400


Bill http://web.mac.com/wkhatch



On Sep 18, 2008, at 4:01 PM, Chuck Hill wrote:


On Sep 18, 2008, at 12:50 PM, William Hatch wrote:

Just migrated a project to mysql, and now all methods that used the ERXEOControlUtilities.objectWithPrimaryKey() method no longer work and throw the following exception:

Sep 18 15:21:38 Analytics[55555] (ERXNSLogLog4jBridge.java:41) WARN NSLog - <com.codefab.analytics.DirectAction>: Exception in performActionNamed() on the action "pkFetchWithMySQLProblem" with the message: com.webobjects.jdbcadaptor.JDBCAdaptorException: The attribute id should be assigned a Number, but the value was the String "1000002"
java.lang.reflect.InvocationTargetException
[2008-09-18 15:21:38 EDT] <WorkerThread5> com.webobjects.jdbcadaptor.JDBCAdaptorException: The attribute id should be assigned a Number, but the value was the String "1000002"
at com .webobjects.jdbcadaptor.JDBCColumn.takeInputValue(JDBCColumn.java: 557)
at com .webobjects .jdbcadaptor .JDBCChannel ._bindInputVariablesWithBindingsAndExecute(JDBCChannel.java:226)
at com .webobjects .jdbcadaptor.JDBCChannel._evaluateExpression(JDBCChannel.java:303)
at com .webobjects .jdbcadaptor.JDBCChannel.evaluateExpression(JDBCChannel.java:261)
at com .webobjects .jdbcadaptor.JDBCChannel.selectAttributes(JDBCChannel.java:185)


This was working in FB no problem. I was initially passing the string representing the decoded id from the request as the argument to the method. But, I've tried all the EOUtilitiesMethods, converting the pk string into a GID or converting it into an Integer, but I always get this value massaged into a string. Here's the current call:

EOUtilities.objectWithPrimaryKeyValue(ec, entityName, new Integer(pkValue)); where pkValue is a string, ec and entityName are pretty obvious hopefully;-)

What am I doing wrong? Could this be a bug?



The FB plugin does auto conversion of some types. This basically allows you to pass invalid values to these methods and FB covers up your sins. Other plugings are more strict in terms of what they will let you away with.


Chuck

Thanks Chuck. But why would it convert from an Integer back into a string? I can understand that mysql won't do the nice thing and convert from the string into the Integer for you, but I'd expect that if I pass it an integer it would do the right thing.









_______________________________________________ Do not post admin requests to the list. They will be ignored. Webobjects-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
  • Follow-Ups:
    • Re: Mysql and pk fetches with EOUtil or ERXEOControlUtil. Adaptor bug?
      • From: Chuck Hill <email@hidden>
References: 
 >Mysql and pk fetches with EOUtil or ERXEOControlUtil. Adaptor bug? (From: William Hatch <email@hidden>)
 >Re: Mysql and pk fetches with EOUtil or ERXEOControlUtil. Adaptor bug? (From: Chuck Hill <email@hidden>)

  • Prev by Date: Re: Mysql and pk fetches with EOUtil or ERXEOControlUtil. Adaptor bug?
  • Next by Date: Re: Mysql and pk fetches with EOUtil or ERXEOControlUtil. Adaptor bug?
  • Previous by thread: Re: Mysql and pk fetches with EOUtil or ERXEOControlUtil. Adaptor bug?
  • Next by thread: Re: Mysql and pk fetches with EOUtil or ERXEOControlUtil. Adaptor bug?
  • Index(es):
    • Date
    • Thread