• 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
Long running query shows null date bindings
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Long running query shows null date bindings


  • Subject: Long running query shows null date bindings
  • From: "Ruggentaler, JR" <email@hidden>
  • Date: Wed, 10 Jul 2013 22:28:50 +0000
  • Thread-topic: Long running query shows null date bindings

When Wonder detects a long running query it logs the SQL and bindings. If the binding is a NSTimestamp the log shows null. See example below.

"EntityName"@4113761 _expression_ took 11022 ms: SELECT t0.COLX, ... FROM TABLE_1 t0, TABLE_2 T1 WHERE (T1.PROVIDER_ID = ? AND T1.DATE_DELETED is NULL AND T1.IS_LATEST = ? AND t0.USER_GROUP_ID = ? AND T1.PATIENT_ID = ? AND t0.START_DATE = ?) AND t0.ENCOUNTER_ID = T1.ENCOUNTER_ID withBindings: 1:###[providerID], 2:###[isLatest], 3:###[userGroupID], 4:####[patientID], 5:NULL[startDate]
java.lang.RuntimeException: Statement running too long

I made a minor change to ERXEOAccessUtilities.createLogString() to log the NSTimestamp value. Below is the patch, can someone review and apply the patch please?

Index: Wonder/Frameworks/Core/ERExtensions/Sources/er/extensions/eof/ERXEOAccessUtilities.java
===================================================================
--- Wonder/Frameworks/Core/ERExtensions/Sources/er/extensions/eof/ERXEOAccessUtilities.java (revision 3)
+++ Wonder/Frameworks/Core/ERExtensions/Sources/er/extensions/eof/ERXEOAccessUtilities.java (working copy)
@@ -58,6 +58,7 @@
 import com.webobjects.foundation.NSMutableDictionary;
 import com.webobjects.foundation.NSMutableSet;
 import com.webobjects.foundation.NSSet;
+import com.webobjects.foundation.NSTimestamp;
 import com.webobjects.foundation._NSDelegate;
 import com.webobjects.jdbcadaptor.JDBCPlugIn;
 
@@ -1243,6 +1244,8 @@
             obj = EOSQLExpression.sqlStringForString((String) obj);
         } else if (obj instanceof Number) {
          obj = EOSQLExpression.sqlStringForNumber((Number) obj);
+        } else if (obj instanceof NSTimestamp) {
+         obj = obj.toString();
         } else if (obj instanceof NSData) {
             // ak: this is just for logging, however we would
             // like to get readable data

JR

 _______________________________________________
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

  • Prev by Date: Re: WOWODC 2014
  • Next by Date: Re: strange behavior with saveChanges
  • Previous by thread: [SOLVED] Re: strange behavior with saveChanges
  • Next by thread: Where has WebObjects543.dmg gone?
  • Index(es):
    • Date
    • Thread