What a disaster... Even if I wanted to parse that to construct an
error message, I don't get all the keys that are required by the
unique constraint. :-/
The constraint name is what you really want. Maybe you can dig down
into the SQLException and extract it. Every database is different.
Some are more different than others.
Anyway, I do have a question related to this: Is it possible to get
a handle to the eo in there? I can't find it in the db context or
the throwable. Right now, the best I can do is throw a
"Could not save your changes: The value was not unique."
I suppose that's better than crashing, but it's not exactly helpful
either. Perhaps I could reconstruct the object in a disposable ec
from the failed AdaptorOperation and pass that 'clone' object to the
validation factory? Or is that asking for trouble? If I could just
get "Parent.parentName.UniqueConstraintException" I could at least
make a reasonable assumption about the unique constraint in some/
most cases.
You can get the exact EO if the constraint is not deferred. If it is
deferred, you are out of luck. You can match up the table name to the
entity name (give or take some inheritance quirks).
_______________________________________________
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