ERXLocalizer getting rid of the binding errors?

2008-07-04 Thread Paul Stringer
Hi all, I'm using ERXLocalizer and getting values from it using KVC bindings in my WODs. When I do this with WOLips I get the errors There is no key '$key' for the keypath 'localizer' in '$YourComponent'' I want to get rid of them all but not sure how. My bindings look like:

Re: ERXLocalizer getting rid of the binding errors?

2008-07-04 Thread Anjo Krank
Use loc:value=foo.bar.baz. Cheers, Anjo -- iFill, free music from thousands of radio streams http://ifill.twosailors.net Am 04.07.2008 um 08:43 schrieb Paul Stringer: Hi all, I'm using ERXLocalizer and getting values from it using KVC bindings in my WODs. When I do this with WOLips I get

Re: DB uniqueness constraints and dealing with them

2008-07-04 Thread Q
On 04/07/2008, at 1:01 PM, Florijan Stamenkovic wrote: The save - error check is exactly what I had in mind, sorry if I was not clear about it. However, I would rather like to delete the newly saved EO, and throw a validation exception. But this is only possible if I can find the exactly

empty relationship qualifier question

2008-07-04 Thread Michael Bushkov
Hi, I have quite simple task, but I don't see any proper solution. The task is as follows: I have 2 entities - Song and Track. Song has a one-to-many relationship to Track (Song-tracks). And I need to fetch all songs which have no tracks. That's all - plain and simple. I've looked through the

Re: WOXMLCoder uses objectIDRef for mutable objects

2008-07-04 Thread Timo Hoepfner
Anjo is right, I was wrong. I thought, System.identityHashCode() would be safe, at least when the objects are in 32 bit address space and are not garbage collected during the process, but a simple test turned out that this is wrong, probably due to the JVM memory management shuffeling

Re: ERXLocalizer getting rid of the binding errors?

2008-07-04 Thread Mike Schrag
Use loc:value=foo.bar.baz. Don't you have to register something in your Application constructor to use this? Also, localizer should be allowed everywhere: inline: pastedGraphic.png Are your settings not set like this? These are defaults. ms ___

Re: WOXMLCoder uses objectIDRef for mutable objects

2008-07-04 Thread Mike Schrag
One solution I could think to which should work would be to use an IdentityHasMap inside of WOXMLCoder to keep track ofthe objects. I think this is the only solution, actually (ok, not the only solution, but the other solutions are isomorphic to this solution :) ) ms

Re: DB uniqueness constraints and dealing with them

2008-07-04 Thread Paul Stringer
With the following I was able to get the keys and values with some regexing, but not very database independant but does work with FrontBase. It relies on the sql exception message predictably containing the key and value information. Wether other databases do I don't know but you may get

[SOLVED] Re: DB uniqueness constraints and dealing with them

2008-07-04 Thread Florijan Stamenkovic
Right all, well, thanks everyone for sinking that ship of an idea down to the abyss, where it apparently belongs :) Arghhh... So, the seems to be no way to really properly handle this, is there? Paul, thanks for the code, I am currently deploying on OpenBase, I will look into what kind

Re: [SOLVED] Re: DB uniqueness constraints and dealing with them

2008-07-04 Thread Florijan Stamenkovic
One more question though... An adapter exception *is* thrown, regardless of the database backing EOF, right? No standardized info is provided, but it is guaranteed that the exception is thrown, right??? F On Jul 04, 2008, at 11:03, Florijan Stamenkovic wrote: Right all, well, thanks

Re: [SOLVED] Re: DB uniqueness constraints and dealing with them

2008-07-04 Thread Chuck Hill
On Jul 4, 2008, at 8:11 AM, Florijan Stamenkovic wrote: One more question though... An adapter exception *is* thrown, regardless of the database backing EOF, right? No standardized info is provided, but it is guaranteed that the exception is thrown, right??? Yes, that much works. On

Re: [SOLVED] Re: DB uniqueness constraints and dealing with them

2008-07-04 Thread Miguel Arroz
Hi! What I do in those situations is searching for the name of the constraint. Like: catch (EOGeneralAdaptorException saveException) { if (Util.isOptimisticLockingFailure(saveException)) { NSLog.out.appendln(saveAnswersOnSurvey - Optimistic locking failure); } else if (

Re: Practical Webobjects Utilities Framework

2008-07-04 Thread Jeff Schmitz
On page 250 of Practical Webobjects, it shows an example of using the EOCopyable interface's default implementation inner class. Shouldn't the example class (CopyableGenericRecord) implement the EOCopyable interface? The listing doesn't show this, and if you try to use it as shown, a

Re: Practical Webobjects Utilities Framework

2008-07-04 Thread Jeff Schmitz
A related question, in the EOCopyable Utility innerclass code, the first line (line 613) of deepCopyRelatedObjects is a debug statement: copyLogger.debug(Shallow copying relationships for + globalIDForObject(source)); Why does this say

Re: [SOLVED] Re: DB uniqueness constraints and dealing with them

2008-07-04 Thread Neil MacLennan
In case anyone's building a library here... this is some code for MySQL uniqueness (with some credit to Practical WebObjects Ch 5). I think that's Frontbase, Openbase, Postgres and MySQL covered so far... snippet try { editingContext.saveChanges(); } catch (EOGeneralAdaptorException e) {

Re: [SOLVED] Re: DB uniqueness constraints and dealing with them

2008-07-04 Thread Florijan Stamenkovic
Well, OpenBase is not covered yet, but I am working on it :) The SQL error is provided, so some regexing should do the trick. However, the code below does not extrapolate the column name from the exception, do you maybe have some code for that? Thx, F On Jul 04, 2008, at 15:00, Neil

Re: empty relationship qualifier question

2008-07-04 Thread Pierre Bernard
Hi! Actually, EOKeyValueQualifier(tracks, EOQualifier.QualifierOperatorEquals, NSKeyValueCoding.NullValue) should work just fine. Please report back if it doesn't. I'd like to know. An alternative - usually used only for more complex cases - would be to use the

Re: [SOLVED] Re: DB uniqueness constraints and dealing with them

2008-07-04 Thread Neil MacLennan
On 4 Jul 2008, at 20:13, Florijan Stamenkovic wrote: However, the code below does not extrapolate the column name from the exception, do you maybe have some code for that? Sadly I don't :-( The MySQL error (1062) returns a message like, ERROR 1062 (23000): Duplicate entry 'AB1' for key 3

Re: Practical Webobjects Utilities Framework

2008-07-04 Thread Chuck Hill
On Jul 4, 2008, at 8:57 AM, Jeff Schmitz wrote: On page 250 of Practical Webobjects, it shows an example of using the EOCopyable interface's default implementation inner class. Shouldn't the example class (CopyableGenericRecord) implement the EOCopyable interface? The listing doesn't

Re: Practical Webobjects Utilities Framework

2008-07-04 Thread Chuck Hill
On Jul 4, 2008, at 9:21 AM, Jeff Schmitz wrote: A related question, in the EOCopyable Utility innerclass code, the first line (line 613) of deepCopyRelatedObjects is a debug statement: copyLogger.debug(Shallow copying relationships for +

Re: DB uniqueness constraints and dealing with them

2008-07-04 Thread Chuck Hill
I guess I will play show and tell too :-) It all starts in an EOEditingContext subclass, with the saveChanges method: public void saveChanges() { try { super.saveChanges(); } catch (EOGeneralAdaptorException e) { throw

Re: Zombies and Dead WOAs... Part Two..

2008-07-04 Thread Chuck Hill
On Jun 26, 2008, at 11:11 PM, John Lennard wrote: On Jun 26, 2008, at 9:22 PM, John Lennard wrote: Okay, So I will try this again, having been bested by my mail program :-/ I restrained myself from poking fun at you. :-P You are more than welcome to poke fun, i deserve it.. it has been

Re: Zombies and Dead WOAs... Part Two..

2008-07-04 Thread Chuck Hill
That very much sounds like what happens if sleep() or terminate() in Session throw an exception. When this happens next, use jstack to get a thread dump and see if you can see what is stuck. Chuck On Jun 27, 2008, at 5:01 AM, Ian Coleman wrote: I am having the same problem, can't stop