|
| [Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] |
| Hi Ray, Thank you for the tip. That's something interesting to change the sql _expression_ on the fly. I was looking for that too. But you don't get me so I gonna try to be explain with more concise explanations. The algorithm is the following: 1 - get data from the DA, check data and return a result (basically 2 results : data accepted or not) 2 - if result = data_accepted, I insert new data using raw sql 3 - write into a log entity (in any circumstances) using EOF aka create an object and insert it into an ec. What I tried to explain is that when the EOUtilities.rawRowsForSQL is executed in step 2 (and it works, I don't have any issue here), the step 3 fails because he can't get a primary key. If the step 2 is not executed, the step 3 is executed successfully. I put the simple code below that is executed, just in case but nothing weird I guess (I removed the try/catch). Cheers, Philippe String aIpAdress = (String) userInfo.get(NotificationUserInfoEnum.IP_ADDRESS.toString()); String aRequest = notificationData.getSenderUri(); String aStatus = (String) userInfo.get(NotificationUserInfoEnum.STATUS.toString()); EOEditingContext ec = ERXEC.newEditingContext(); ec.lock(); NOApplication anApplication = null; if (notificationData.getApplicationName() != null) anApplication = NBCacheManager.getInstance().application(ec, notificationData.getApplicationName(), notificationData.getPlatform()); NONotificationRequestLog notificationLog = NONotificationRequestLog.createAndInsertNONotificationRequestLog(ec); if (anApplication!=null) { notificationLog.setApplication(anApplication); notificationLog.setApplicationName(anApplication.name()); } else if (notificationData.getApplicationName() != null) notificationLog.setApplicationName(notificationData.getApplicationName()); //If a notification is received, we don't know the platform if (!(this instanceof NBNotificationReceivedRecorder)) notificationLog.setPlatform(notificationData.getPlatform()); notificationLog.setIpAddress(aIpAdress); notificationLog.setRequest(aRequest); notificationLog.setStatus(aStatus); ec.saveChanges(); On 5 sept. 2011, at 01:08, Ray Kiddy wrote:
|
_______________________________________________ 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: | |
| >Feedback about issue with MySQL and get primary key (From: Philippe Rabier <email@hidden>) | |
| >Re: Feedback about issue with MySQL and get primary key (From: Ray Kiddy <email@hidden>) |
| Home | Archives | Terms/Conditions | Contact | RSS | Lists | About |
Visit the Apple Store online or at retail locations.
1-800-MY-APPLE
Contact Apple | Terms of Use | Privacy Policy
Copyright © 2011 Apple Inc. All rights reserved.