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) );
spec.setRefreshesRefetchedObjects(true);
printedTicketList = ec.objectsWithFetchSpecification(spec);
return printedTicketList;
This also results in a Exception.
Mar 09 22:38:27 kassa[60036] DEBUG NSLog - evaluateExpression:
<com.webobjects.jdbcadaptor.PostgresqlExpression: "SELECT
t0.ticket_lineitem_id, t0.ticket_adressen_id, t0.ticket_amount1,
t0.ticket_amount2, t0.ticket_amount3, t0.ticket_date_printed,
t0.ticket_date_sold, t0.ticket_employee_id, t0.ticket_external_id,
t0.ticket_hash, t0.ticket_id, t0.ticket_lineitem_uid, t0.ticket_no_of_tickets1,
t0.ticket_no_of_tickets2, t0.ticket_order_id, t0.ticket_paydesksession_id,
t0.ticket_perf_id, t0.ticket_productid, t0.ticket_remarks,
t0.ticket_showattendant_id FROM ticketssold t0 INNER JOIN lineitem T1 ON
t0.ticket_lineitem_uid = T1.lineitem_uid INNER JOIN ORDERS T2 ON T1.order_id =
T2.order_id WHERE (t0.ticket_paydesksession_id = ?::int4 AND T2.cardtype is
NULL) ORDER BY t0.ticket_date_sold ASC" withBindings:
1:770(ticketPaydeskSessionId)>
Mar 09 22:38:27 kassa[60036] DEBUG er.transaction.adaptor.FaultFiring -
databaseContextDidSelectObjects <class
com.webobjects.eocontrol.EOFetchSpecification(entityName=TicketSold,
qualifier=((ticketPaydeskSessionId = 770) and (lineItem.order.cardtype =
null)),
isDeep=true, usesDistinct=false,
sortOrdering=(<class com.webobjects.eocontrol.EOSortOrdering(ticketDateSold
compareAscending)>),
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 5 stack elements
at
com.webobjects.eocontrol.EOObjectStoreCoordinator.objectsWithFetchSpecification(EOObjectStoreCoordinator.java:488)
at
com.webobjects.eocontrol.EOEditingContext.objectsWithFetchSpecification(EOEditingContext.java:4069)
at er.extensions.eof.ERXEC.objectsWithFetchSpecification(ERXEC.java:1211)
at
com.webobjects.eocontrol.EOEditingContext.objectsWithFetchSpecification(EOEditingContext.java:4444)
at nl.netsense.kassa.Session$$M$b532ffda.printedTicketList(Session.java:819)
at
nl.netsense.kassa.Session$$A$b532ffda.printedTicketList(<generated>:Unknown)
at nl.netsense.kassa.Session.printedTicketList(Session.java:820)
... skipped 41 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
What am I doing wrong?
Johan Henselmans
[email protected]
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list ([email protected])
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com
This email sent to [email protected]