Subject | Re: Transaction Problem |
---|---|
Author | sierraja2000 |
Post date | 2009-11-03T20:25:56Z |
ok the invoice number is generate on table, but if user1 is view a invoice No. 1 and user2 need view then invoice No. 1 some time. This generate a dead lock. I want that multi-user can view the some data. Sorry my english
--- In firebird-support@yahoogroups.com, "Carlos H. Cantu" <listas@...> wrote:
>
> AWH> There may be a problem with your database design. Yes, two
> AWH> transactions can generate invoices at the same time without
> AWH> conflicting, but two transactions cannot change the same
> AWH> record at the same time. So, if you have a table you use to
> AWH> generate invoice numbers by reading the value of a field and
> AWH> incrementing it, you will have conflicts. Firebird has generators
> AWH> (also called sequences) that supply unique values; they're
> AWH> faster than keeping a counter in the database and they don't
> AWH> cause deadlocks.
>
> Major problem is that usually invoice sequence can't be broken, and as
> generators are outside the transaction control, it can happen that a
> "invoice" transaction be rolled back when the generator was already
> incremented, what would result in a broken sequence.
>
> In the IBO site, there is a paper that comments some solutions to the
> problem:
>
> http://www.ibobjects.com/docs/ti_AuditableSeries.ZIP
>
> Carlos
> Firebird Performance in Detail - http://videos.firebirddevelopersday.com
> www.firebirdnews.org - www.FireBase.com.br
>