[DB-SIG] Portable method of determining which column wasn't unique?

Johannes Erdfelt johannes@erdfelt.com
Thu, 10 Oct 2002 16:51:07 -0400


On Thu, Oct 10, 2002, Magnus Lycka <magnus@thinkware.se> wrote:
> At 15:57 2002-10-10 -0400, Johannes Erdfelt wrote:
> >That has the same races as the possible solution I came up with that I
> >described at the end of my original email.
> 
> I was about to say that there is no race
> condition here in in SQL if you have high
> enough isolation level, but then I realize
> that you use MySQL...
> 
> I think you need to use a RDBMS that handles
> transactions as SQL requires to be safe here,
> i.e. almost anything but MySQL, or even MySQL
> if you use transaction aware tables. (I'm not
> enough of an expert on MySQL to be sure that
> they really handle ACID properly...)

But why carry around the transaction baggage when the information is
available?

It does tell me what key caused the problem and I'm sure there's some
place to get the information to put all of the pieces together.

Although, looking at some of the other databases, this doesn't look like
it'll be portable at all. The details on the backend seem to vary enough
that an abstracted API may be unreasonable or just not worth it.

And yes, MySQL is ACID compliant for certain table types (InnoDB for
one).

JE