Subject | Re: Poor selectivity in foreign keys |
---|---|
Author | johnmancuk |
Post date | 2004-10-16T12:55:54Z |
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 trans1.new
values, because both are in limbo. If you commit trans1 you could
then refer to trans1.new, if you rollback trans1 you could then
refer to trans1.old.
This kind of magic is only possible with indexes.
John
--- In firebird-support@yahoogroups.com, "Salvatore Besso"
<s.besso@m...> wrote:
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 trans1.new
values, because both are in limbo. If you commit trans1 you could
then refer to trans1.new, if you rollback trans1 you could then
refer to trans1.old.
This kind of magic is only possible with indexes.
John
--- In firebird-support@yahoogroups.com, "Salvatore Besso"
<s.besso@m...> wrote:
> hello John,correct value
>
> > 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
> (maybe with a refresh before making changes), or am I missingsomething?
>
> Regards
> Salvatore