On Feb 21, 6:06 pm, David Symonds <dsymo...@gmail.com> wrote:
> On Sun, Feb 22, 2009 at 4:39 AM, Koen Bok <k...@madebysofa.com> wrote:
> > Hey all. By tax law, invoice numbers need to always be unique and
> > sequential. Anyone has an idea to approach this on AppEngine in a
> > sensible way?
>
> Use a global counter that you access in a transaction. Of course, that
> won't scale perfectly, but I think you'll have other problems if
> you're generating invoices that fast!

Keep in mind that a failure at /just/ the right moment can result in a
gap here. If you create the invoice in the transaction as well, this
can be avoided, but obviously scalability will take another hit.

Another option would be to assign invoice numbers after the fact -
periodically query for all invoices without an invoice number, sorted
by creation time, and assign them numbers in a loop. I don't know if
tax law allows this, of course.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To post to this group, send email to google-appengine@googlegroups.com
To unsubscribe from this group, send email to 
google-appengine+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to