Subject Re: Poor selectivity in foreign keys
Author johnmancuk
If it's read committed you can only see committed values! The update
in trans 1 isn't committed yet - so isn't visible from trans 2.

Try it!

I always think Firebird isolation is a bit like Relativity...
everything depends of frames of reference!

If you used proper RI and had indexes, the action in trans 2 would
fail because it would know the value was changed in trans 1, even
though it's not committed. Kinda like a dirty-read, but not!

In fact it would stop you refering to both trans1.old and
values, because both are in limbo. If you commit trans1 you could
then refer to, if you rollback trans1 you could then
refer to trans1.old.

This kind of magic is only possible with indexes.


--- In, "Salvatore Besso"
<s.besso@m...> wrote:
> hello John,
> > Trans 2:
> > Insert child record refering to original value
> > in master (which is still visible in this trans
> > context)
> > Commit
> >
> > RI broken
> if I remember well, if isolation is read committed trans2 sees the
correct value
> (maybe with a refresh before making changes), or am I missing
> Regards
> Salvatore