Hi all,
While reading older discussions on dealing with DB uniqueness
restraints I've found out that the EOGeneralAdaptorException thrown
differs among databases. Is there some generic code that deals with
this in absolute terms ( don't you just *love* the word absolute
being used in conj
On Jul 03, 2008, at 12:58, Florijan Stamenkovic wrote:
Hi all,
While reading older discussions on dealing with DB uniqueness
restraints I've found out that the EOGeneralAdaptorException thrown
differs among databases. Is there some generic code that deals with
this in absolute terms ( do
While reading older discussions on dealing with DB uniqueness
restraints I've found out that the EOGeneralAdaptorException thrown
differs among databases. Is there some generic code that deals with
this in absolute terms ( don't you just *love* the word absolute
being used in conjunction wi
On Jul 03, 2008, at 14:35, Mike Schrag wrote:
While reading older discussions on dealing with DB uniqueness
restraints I've found out that the EOGeneralAdaptorException
thrown differs among databases. Is there some generic code that
deals with this in absolute terms ( don't you just *love*
On 04/07/2008, at 2:58 AM, Florijan Stamenkovic wrote:
Hi all,
While reading older discussions on dealing with DB uniqueness
restraints I've found out that the EOGeneralAdaptorException thrown
differs among databases. Is there some generic code that deals with
this in absolute terms ( do
What about doing
save -> if error check to see if existing record exists and if so
throw up a duplicate error ?
On Jul 4, 2008, at 7:52 AM, Q wrote:
On 04/07/2008, at 2:58 AM, Florijan Stamenkovic wrote:
Hi all,
While reading older discussions on dealing with DB uniqueness
restraints
On 04/07/2008, at 10:30 AM, Jerome Chan wrote:
What about doing
save -> if error check to see if existing record exists and if so
throw up a duplicate error ?
Same race condition applies.
On Jul 4, 2008, at 7:52 AM, Q wrote:
On 04/07/2008, at 2:58 AM, Florijan Stamenkovic wrote:
Hi a
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 same EO, once before it saved to the db,
and once after.
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 s
On Jul 3, 2008, at 9:47 PM, Lachlan Deck wrote:
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
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
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 so
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 i
A slightly modified version of Chuck's db specific stuff, for OpenBase:
public class OpenBaseExInterpreter implements ExInterpreter{
private Pattern
column = Pattern.compile("column \\'(.*)\\' is not unique"),
table = Pattern.compile("SQL\\: INSER
Uhm sorry, that was partly bad. Matcher will not find any groups
unless one of the matching methods is invoked on it first... The
working version of the code is:
public class OpenBaseExInterpreter implements ExInterpreter{
private Pattern
column = Pattern.comp
Hi Florijan,
be aware that your solution will only work for english installation of
Oracle. Otherwise you will have custom error messages in the
installation language.
Regards
Susanne
--
Susanne Schneider
Coordinator secuTrial Development
iAS interActive Systems GmbH
Dieffenbachstraße 33 c, D-1
Susane,
My solution if for OpenBase only. Though I guess that the different
languages issue might be applicable to it too. I'll have to check.
Thx,
F
On Jul 10, 2008, at 04:40, Susanne Schneider wrote:
Hi Florijan,
be aware that your solution will only work for english installation
of O
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 of
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 everyon
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
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
( saveE
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...
try {
editingContext.saveChanges();
} catch (EOGeneralAdaptorException e) {
if
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 MacLen
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"
24 matches
Mail list logo