Subject | Re: AW: AW: [firebird-support] difficult question |
---|---|
Author | Tupy... nambá |
Post date | 2013-12-06T17:17:46Z |
Dear mrs.Ann,
Thanks for you remembering, excuse me for losing the focus.
Mr.Olaf is using almost no code in the application, he is working "data-bound". If he was using triggers, he could do it more easily yet, with generators. And he has almost no control about the lock, because he is using MsAccess to do that.
I sugest him learn how to increase the quality of his application, where all this
points will be better resolved.
Thanks a lot, best regards,
Roberto Camargo.
On Friday, December 6, 2013 1:49 PM, Ann Harrison <aharrison@...> wrote:
Since this discussion has wandered off into German, I'm going to put this
as bluntly as possible in English.
Never use "select max (id) + 1 from targetTable" to create unique identifiers. It's
the worst kind of bug - one that works when you test your code in single user
mode, and fails unpredictably in production. It's also very slow.
This warning applies to Firebird and all MVCC databases, and to databases
that use lock-based concurrency control if you use either Read Committed or
Repeatable Read isolation modes.
Generators (aka sequences) were created for a reason. Use them.
Luck doesn't enter into it.
Cheers,
Ann