• 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: Fetch objects: Error in MYSQL or WO
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Fetch objects: Error in MYSQL or WO


  • Subject: Re: Fetch objects: Error in MYSQL or WO
  • From: "Daniele Corti" <email@hidden>
  • Date: Thu, 19 Apr 2007 12:32:54 +0200



2007/4/19, Cheong Hee (Datasonic) <email@hidden>:
Row 206 is the error where I did the object enumeration after the fetched:
                    ProjectExecutionTemplate anObject = (ProjectExecutionTemplate)enumerator.nextElement();

So you do :
EOFetchSpecification fs = new EOFetchSpecification("ProjectExecutionTemplate", nameQualifier, null, true, true, sortOrdering);
NSArray foundList = context.objectsWithFetchSpecification(fs);
Enumerator enumerator = foundList.objectEnumerator();
while(enumerator.hasMoreElements()){
         ProjectExecutionTemplate anObject = (ProjectExecutionTemplate)enumerator.nextElement();
         /**other code**/
}

if so, it's very strange... how is the instance diagram? Has ProjectExecutionTemplate and ProjectActorRoleTemplate any relations/shared Parent/ etc.?
----- Original Message -----
From: Daniele Corti
To: Cheong Hee (Datasonic)
Cc: WO-Apple-Dev
Sent: Thursday, April 19, 2007 5:15 PM
Subject: Re: Fetch objects: Error in MYSQL or WO



2007/4/19, Cheong Hee (Datasonic) <email@hidden>:
I have an application that is using this fetch defined in "getAllObjects":
     ....
    
     .....etc
 
Everything "seems" working, however when fetch this particular table, this message has thrown out :: It was complaining the class cast exception that instead of ProjectExecutionTemplate, WO looks that the objects fetched are of ProjectActorRoleTemplate class!!  The SQL trace shows correctly that all 12 rows are fetched.
 
=== trace 1 === error
[2007-04-19 16:00:17 SGT] <WorkerThread0>  evaluateExpression: <com.webobjects.jdbcadaptor.MySQLPlugIn$MySQLExpression: "SELECT DISTINCT t0.ABBREVIATION_NAME, t0.CODE, t0.IS_ACTIVE, t0.IS_DEFAULT, t0.SEQUENCE_NUMBER, t0.TEMPLATE_KEY, t0.VDESCRIPTION, t0.VNAME FROM PROJECT_EXECUTION_TEMPLATE t0 WHERE UPPER(t0.VNAME) LIKE UPPER(?) ESCAPE '|'" withBindings: 1:"%"(vName)>
[2007-04-19 16:00:17 SGT] <WorkerThread0> 12 row(s) processed
[2007-04-19 16:00:17 SGT] <WorkerThread0>  === Commit Internal Transaction
java.lang.ClassCastException: com.rhino.model.ProjectActorRoleTemplate
 at com.rhino.model.ProjectExecutionTemplate.getAllObjects(ProjectExecutionTemplate.java:206)

 whitch row is 206?
one of these?
EOFetchSpecification fs = new EOFetchSpecification("ProjectExecutionTemplate", nameQualifier, null, true, true, sortOrdering);
     NSArray foundList = context.objectsWithFetchSpecification(fs);


 at ProjectExecutionPage.initializeDisplayGroup(ProjectExecutionPage.java:110)
 
 
So, spent some time on error searching... and finally reach a point that if I changed the primary key in ProjectExecutionTemplate database, e.g.:
 (NULL,NULL,1,NULL,NULL,1000007,NULL,'Design/Development'),  ==> changed to
 (NULL,NULL,1,NULL,NULL,10007,NULL,'Design/Development'),  ==> Note that "1000007" to "10007"
 

When run the app again, everything worked! See below:
==== trace 2 ==== good one
[2007-04-19 16:03:45 SGT] <WorkerThread1>  evaluateExpression: <com.webobjects.jdbcadaptor.MySQLPlugIn$MySQLExpression: "SELECT DISTINCT t0.ABBREVIATION_NAME, t0.CODE, t0.IS_ACTIVE, t0.IS_DEFAULT, t0.SEQUENCE_NUMBER, t0.TEMPLATE_KEY, t0.VDESCRIPTION, t0.VNAME FROM PROJECT_EXECUTION_TEMPLATE t0 WHERE UPPER(t0.VNAME) LIKE UPPER(?) ESCAPE '|'" withBindings: 1:"%"(vName)>
[2007-04-19 16:03:45 SGT] <WorkerThread1> 12 row(s) processed
[2007-04-19 16:03:45 SGT] <WorkerThread1>  === Commit Internal Transaction
 
 
So what my question is: what has gone wrong actually? 
Primary key overflow?
Faults in MYSQL or WO or "programmer"?  (primary key is defined as int(11) in MYSQL)
How could Class Cast Exception happen in the first place?  (though both subclass from Template..)
 
Puzzled....Appreciate comments.  [WO5.2.4/MYSQL v 5.0.22]
 
Cheers
 
Cheong Hee
 

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      ( email@hidden)
Help/Unsubscribe/Update your

This email sent to email@hidden



--
Daniele Corti
AIM: S0CR4TE5
Messenger: email@hidden



--
Daniele Corti
AIM: S0CR4TE5
Messenger: email@hidden
 _______________________________________________
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

References: 
 >Fetch objects: Error in MYSQL or WO (From: "Cheong Hee (Datasonic)" <email@hidden>)
 >Re: Fetch objects: Error in MYSQL or WO (From: "Daniele Corti" <email@hidden>)
 >Re: Fetch objects: Error in MYSQL or WO (From: "Cheong Hee (Datasonic)" <email@hidden>)

  • Prev by Date: Re: Off-Topic - What GUI designer?
  • Next by Date: Re: Off-Topic - What GUI designer?
  • Previous by thread: Re: Fetch objects: Error in MYSQL or WO
  • Next by thread: Re: Fetch objects: Error in MYSQL or WO
  • Index(es):
    • Date
    • Thread