Raji Sridar (raji) wrote:
Hi,
We use a typical counter within a transaction to generate order
sequence number and update the next sequence number. This is a simple
next counter - nothing fancy about it. When multiple clients are
concurrently accessing this table and updating it, under extermely
heavy loads in the system (stress testing), we find that the same
order number is being generated for multiple clients. Could this be a
bug? Is there a workaround? Please let me know.
without seeing your code, its hard to say where this bug is, in your
counter implementation, or in postgres. you also don't say what version
of postgres you're using, or even what OS you're running under...
sounds like you should be using a SERIAL (which is implemented as an
INTEGER or BIGINT field with an associated SEQUENCE), as these DO work
just fine under heavy concurrency without any gotchas.
--
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general