• 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: Strange SQL Statement generated....
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Strange SQL Statement generated....


  • Subject: Re: Strange SQL Statement generated....
  • From: Chuck Hill <email@hidden>
  • Date: Wed, 3 Sep 2008 19:17:42 -0700


On Sep 3, 2008, at 7:05 PM, Owen McKerrow wrote:

Hi All,

Updating an old application and have come across a very weird situation. Code which was working fine 2 days ago now produces an error. So I made the simplest test case I could and yet I still get the error.....

GeneralInfo gi = (GeneralInfo)EOUtilities.objectWithFetchSpecificationAndBindings(ec, "GeneralInfo", "find", new NSDictionary());
gi.setUpdaterRunning(new Integer(3));
ec.saveChanges();


which produces the following SQL and error message

....
11:58:39,855 DEBUG [Thread-1] (Log.NSLogDebug:1546 appendln) - evaluateExpression: <com.webobjects.jdbcadaptor.OraclePlugIn $OracleExpression: "SELECT t0.client_id, t0.common_rules, t0.general_info, t0.menu_Message, t0.updater_running FROM GENERAL_INFO t0 WHERE t0.client_id = ?" withBindings: 1:2(client_id)>
11:58:39,863 DEBUG [Thread-1] (Log.NSLogDebug:1546 appendln) - 1 row(s) processed
11:58:39,864 DEBUG [Thread-1] (Log.NSLogDebug:1546 appendln) - === Commit Internal Transaction


11:58:39,881 DEBUG [Thread-1] (Log.NSLogDebug:1546 appendln) - === Begin Internal Transaction
11:58:39,881 DEBUG [Thread-1] (Log.NSLogDebug:1546 appendln) - evaluateExpression: <com.webobjects.jdbcadaptor.OraclePlugIn $OracleExpression: "SELECT t0.client_id, t0.common_rules, t0.general_info, t0.menu_Message, t0.updater_running FROM GENERAL_INFO t0 WHERE t0.client_id = ? FOR UPDATE" withBindings: 1:2(client_id)>

Are you using Vertical Inheritance? If so, I think this can produce this FOR UPDATE. Or maybe it is an EOF in concert with VI. Otherwise, something is messed up in your model or code and making EOF confused. What has changed in the last two days? svn log -verbose is your friend here





11:58:39,893 DEBUG [Thread-1] (Log.NSLogDebug:1546 appendln) - 1 row(s) processed
11:58:39,898 DEBUG [Thread-1] (Log.NSLogDebug:1546 appendln) - === Rollback Internal Transaction
11:58:39,898 DEBUG [Thread-1] (Main:187 doUpdate) - updateStatementForRow: qualifier may not be null
11:58:39,934 OFF [Thread-1] (Log.NSLogErr:1546 appendln) - EXCEPTION:
updateStatementForRow: qualifier may not be null

That looks like there is no PK or locking on all columns has been turned off or something dreadful like that. Give that model a close once over.



DATE/TIME:
2008-09-04 01:58:39 Etc/GMT

null

STACK TRACE:
at _exceptionWithDatabaseContextInformationAdded(EODatabaseContext.java: 4685)
at performChanges(EODatabaseContext.java:6393)
at saveChangesInEditingContext(EOObjectStoreCoordinator.java:415)
at saveChanges(EOEditingContext.java:3226)
at doUpdate(SyncUtil.java:114)
at run(SyncUtil.java:81)


I don't understand why it wants to fetch the GeneralInfo object from the database again? And I don't think I have ever seen SQL "FOR UPDATE" which is tacked onto the end of the second select statement.

Can anyone suggest what may be going on and why ?


Hopefully the above will shed some light.

Chuck


-- Chuck Hill Senior Consultant / VP Development

Practical WebObjects - for developers who want to increase their overall knowledge of WebObjects or who are trying to solve specific problems.
http://www.global-village.net/products/practical_webobjects







_______________________________________________ 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: 
 >Strange SQL Statement generated.... (From: Owen McKerrow <email@hidden>)

  • Prev by Date: Strange SQL Statement generated....
  • Next by Date: performance bottleneck
  • Previous by thread: Strange SQL Statement generated....
  • Next by thread: Re: Strange SQL Statement generated....
  • Index(es):
    • Date
    • Thread