strange Exceptions
While trying to find out why some data did not get saved. I discovered in Debug mode that all kinds of fetches did return an exception, which in turn caused the ERXEC to not do it's thing and save the data in it's EOEditingContext. Removing the fetches that created the Exceptions in a RR-loop resulted in saving the data. But I do not understand where these Exceptions come from. Two Examples: Here I am fetching some program settings, and the program creates an Exception (I assume) at nl.netsense.theater._ProgramSetting.isTest(_ProgramSetting.java:48). This is just an Integer, which is allowed to be empty (0 in the EOModeler setup). NSMutableDictionary currentbindings = new NSMutableDictionary(); currentbindings.setObjectForKey( today,currentdate); // Get the programsettings: for use of (eg) VAT, name of theater, etc. NSDictionary settingsbindings = currentbindings; NSArray settingsList = EOUtilities.objectsWithFetchSpecificationAndBindings(myEc(),ProgramSetting, currentSetting, settingsbindings); setCurrentProgramSetting( (ProgramSetting)settingsList.objectAtIndex(0)); Why would ERXEC create an Eception on something like this? Mar 09 22:39:37 kassa[60036] DEBUG NSLog - evaluateExpression: com.webobjects.jdbcadaptor.PostgresqlExpression: SELECT t0.settings_test, t0.settings_epayment_timeout, t0.settings_id, t0.settings_invoice_external_id, t0.settings_order_check_url, t0.settings_organisation_name, t0.settings_printprogram_path, t0.settings_programhref, t0.settings_program_path, t0.settings_region, t0.settings_reservation_mail_from, t0.settings_reservation_mail_to_2, t0.settings_reservation_mail_to_1, t0.settings_reservation_tel, t0.settings_scriptprogram_path, t0.settings_startdate, t0.settings_stopdate, t0.settings_temp_path, t0.settings_ticket_check_url, t0.settings_ticket_external_id FROM programsettings t0 WHERE t0.settings_id = ?::int4 withBindings: 1:1(settingsId) Mar 09 22:39:37 kassa[60036] DEBUG er.transaction.adaptor.FaultFiring - databaseContextDidSelectObjects class com.webobjects.eocontrol.EOFetchSpecification(entityName=ProgramSetting, qualifier=((settingsId = 1)), isDeep=true, usesDistinct=false, sortOrdering=null, hints=null, _prefetchingRelationshipKeyPaths = null) Exception at er.extensions.eof.ERXDatabaseContextDelegate.databaseContextDidSelectObjects(ERXDatabaseContextDelegate.java:343) ... skipped 4 stack elements at com.webobjects.foundation._NSDelegate._perform(_NSDelegate.java:223) at com.webobjects.foundation._NSDelegate.perform(_NSDelegate.java:167) ... skipped 6 stack elements at com.webobjects.eoaccess.EOAccessFaultHandler.completeInitializationOfObject(EOAccessFaultHandler.java:89) at com.webobjects.eocontrol.EOCustomObject.willRead(EOCustomObject.java:1172) at nl.netsense.theater._ProgramSetting.willRead(_ProgramSetting.java:50001) at nl.netsense.theater.ProgramSetting.willRead(ProgramSetting.java:50001) at com.webobjects.eocontrol._EOMutableKnownKeyDictionary$Initializer$_GenericRecordBinding.valueInObject(_EOMutableKnownKeyDictionary.java:570) at com.webobjects.eocontrol.EOCustomObject.storedValueForKey(EOCustomObject.java:1634) at nl.netsense.theater._ProgramSetting.storedValueForKey(_ProgramSetting.java:50001) at nl.netsense.theater.ProgramSetting.storedValueForKey(ProgramSetting.java:50001) at nl.netsense.theater._ProgramSetting.isTest(_ProgramSetting.java:48) at nl.netsense.theater.ProgramSetting.isTest(ProgramSetting.java:50001) ... skipped 22 stack elements at com.webobjects.appserver.WOAssociation.booleanValueInComponent(WOAssociation.java:276) ... skipped 26 stack elements at nl.netsense.kassa.Application.dispatchRequestImmediately(Application.java:50001) ... skipped 1 stack elements at nl.netsense.kassa.Application.dispatchRequest(Application.java:50001) ... skipped 3 stack elements Second example: I am fetching a bunch of tickets, based on the premisse that the person behind the cashregister is the one that sold the ticket, and that it is a ticket that has no creditcard affiiation: NSMutableArray qualArray = new NSMutableArray(); qualArray.addObject( new EOKeyValueQualifier(ticketPaydeskSessionId, EOQualifier.QualifierOperatorEqual, currentPayDeskSession().paydeskSessionId() ) ); qualArray.addObject( new EOKeyValueQualifier(lineItem.order.cardtype, EOQualifier.QualifierOperatorEqual, null ) ); Object orderings[]={ EOSortOrdering.sortOrderingWithKey(ticketDateSold, EOSortOrdering.CompareAscending) }; EOQualifier andQualifier = new EOAndQualifier( qualArray ); EOFetchSpecification spec = new EOFetchSpecification(TicketSold, andQualifier, new NSArray(orderings) );
Re: strange Exceptions
these don't look like actual exceptions, they just look like the stack traces from where the debug statement occurred ... these things should always say that in their exception message IMO On Mar 9, 2010, at 5:03 PM, Johan Henselmans wrote: While trying to find out why some data did not get saved. I discovered in Debug mode that all kinds of fetches did return an exception, which in turn caused the ERXEC to not do it's thing and save the data in it's EOEditingContext. Removing the fetches that created the Exceptions in a RR-loop resulted in saving the data. But I do not understand where these Exceptions come from. Two Examples: Here I am fetching some program settings, and the program creates an Exception (I assume) at nl.netsense.theater._ProgramSetting.isTest(_ProgramSetting.java:48). This is just an Integer, which is allowed to be empty (0 in the EOModeler setup). NSMutableDictionary currentbindings = new NSMutableDictionary(); currentbindings.setObjectForKey( today,currentdate); // Get the programsettings: for use of (eg) VAT, name of theater, etc. NSDictionary settingsbindings = currentbindings; NSArray settingsList = EOUtilities.objectsWithFetchSpecificationAndBindings(myEc(),ProgramSetting, currentSetting, settingsbindings); setCurrentProgramSetting( (ProgramSetting)settingsList.objectAtIndex(0)); Why would ERXEC create an Eception on something like this? Mar 09 22:39:37 kassa[60036] DEBUG NSLog - evaluateExpression: com.webobjects.jdbcadaptor.PostgresqlExpression: SELECT t0.settings_test, t0.settings_epayment_timeout, t0.settings_id, t0.settings_invoice_external_id, t0.settings_order_check_url, t0.settings_organisation_name, t0.settings_printprogram_path, t0.settings_programhref, t0.settings_program_path, t0.settings_region, t0.settings_reservation_mail_from, t0.settings_reservation_mail_to_2, t0.settings_reservation_mail_to_1, t0.settings_reservation_tel, t0.settings_scriptprogram_path, t0.settings_startdate, t0.settings_stopdate, t0.settings_temp_path, t0.settings_ticket_check_url, t0.settings_ticket_external_id FROM programsettings t0 WHERE t0.settings_id = ?::int4 withBindings: 1:1(settingsId) Mar 09 22:39:37 kassa[60036] DEBUG er.transaction.adaptor.FaultFiring - databaseContextDidSelectObjects class com.webobjects.eocontrol.EOFetchSpecification(entityName=ProgramSetting, qualifier=((settingsId = 1)), isDeep=true, usesDistinct=false, sortOrdering=null, hints=null, _prefetchingRelationshipKeyPaths = null) Exception at er.extensions.eof.ERXDatabaseContextDelegate.databaseContextDidSelectObjects(ERXDatabaseContextDelegate.java:343) ... skipped 4 stack elements at com.webobjects.foundation._NSDelegate._perform(_NSDelegate.java:223) at com.webobjects.foundation._NSDelegate.perform(_NSDelegate.java:167) ... skipped 6 stack elements at com.webobjects.eoaccess.EOAccessFaultHandler.completeInitializationOfObject(EOAccessFaultHandler.java:89) at com.webobjects.eocontrol.EOCustomObject.willRead(EOCustomObject.java:1172) at nl.netsense.theater._ProgramSetting.willRead(_ProgramSetting.java:50001) at nl.netsense.theater.ProgramSetting.willRead(ProgramSetting.java:50001) at com.webobjects.eocontrol._EOMutableKnownKeyDictionary$Initializer$_GenericRecordBinding.valueInObject(_EOMutableKnownKeyDictionary.java:570) at com.webobjects.eocontrol.EOCustomObject.storedValueForKey(EOCustomObject.java:1634) at nl.netsense.theater._ProgramSetting.storedValueForKey(_ProgramSetting.java:50001) at nl.netsense.theater.ProgramSetting.storedValueForKey(ProgramSetting.java:50001) at nl.netsense.theater._ProgramSetting.isTest(_ProgramSetting.java:48) at nl.netsense.theater.ProgramSetting.isTest(ProgramSetting.java:50001) ... skipped 22 stack elements at com.webobjects.appserver.WOAssociation.booleanValueInComponent(WOAssociation.java:276) ... skipped 26 stack elements at nl.netsense.kassa.Application.dispatchRequestImmediately(Application.java:50001) ... skipped 1 stack elements at nl.netsense.kassa.Application.dispatchRequest(Application.java:50001) ... skipped 3 stack elements Second example: I am fetching a bunch of tickets, based on the premisse that the person behind the cashregister is the one that sold the ticket, and that it is a ticket that has no creditcard affiiation: NSMutableArray qualArray = new NSMutableArray(); qualArray.addObject( new EOKeyValueQualifier(ticketPaydeskSessionId, EOQualifier.QualifierOperatorEqual, currentPayDeskSession().paydeskSessionId() ) ); qualArray.addObject( new EOKeyValueQualifier(lineItem.order.cardtype, EOQualifier.QualifierOperatorEqual, null ) ); Object orderings[]={
Re: strange Exceptions
Yep. Patches welcome :) Cheers, Anjo Am 09.03.2010 um 23:18 schrieb Mike Schrag: these don't look like actual exceptions, they just look like the stack traces from where the debug statement occurred ... these things should always say that in their exception message IMO ___ Do not post admin requests to the list. They will be ignored. Webobjects-dev mailing list (Webobjects-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: strange Exceptions
On 9/Mar/2010, at 2:18 PM, Mike Schrag wrote: these don't look like actual exceptions, they just look like the stack traces from where the debug statement occurred ... these things should always say that in their exception message IMO On Mar 9, 2010, at 5:03 PM, Johan Henselmans wrote: at er.extensions.eof.ERXDatabaseContextDelegate.databaseContextDidSelectObjects(ERXDatabaseContextDelegate.java:343) The comment from ERXDatabaseContextDelegate.java, circa line 343 says: * This delegate method is called every time a fault is fired that needs * to go to the database. All we have added is logging statement of the * debug priority. This way during runtime a developer can toggle the * logger priority settting on and off to see what faults are firing. Also * note that when using {...@link ERXPatternLayout} one can set the option to * see full backtraces to the calling method. With this option specified * a developer can see exactly which methods are firing faults. It would appear that Wonder is helping you notice how your application is accessing faults. If you research the incantation to turn off these messages, you might consider submitting a patch which tells the next developer who hits this what's going on and how to change it. ;-) Hey, at least you don't have to set candles and draw a pentagram... M. ___ Do not post admin requests to the list. They will be ignored. Webobjects-dev mailing list (Webobjects-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com