I need to implement a simple accounting subsytem that will record all the transactions for future auditing. This uses two tables: 'transactions' and 'entries'. Transaction->Entry is a parent->child relationship. My customer has two requeriments : All the records(entries/transaction) must be inserted in one database transaction and he wants ensurance that no gaps will ever appear on the ids generated by these two tables
For the first requeriment(everything on one database transaction), I must insert to the 'transactions' table, get the generated id and use that as input for the 'inserts' in the 'entries' table, but everything must be in one transaction, so I can't invoke 'commit' after inserting to 'transactions' to get its generated id. For the second requeriment(ensure that no gaps will happen in the generated ids), I'm not sure its possible to acomplish, since if something fails after the id for 'transaction' is generated, even though that transaction will not be commited, that id will be lost, thus creating a gap. I appreciate insights on how to solve either of these problems. Thanks in advance. Thiago. -- You received this message because you are subscribed to the Google Groups "sqlalchemy" group. To post to this group, send email to sqlalchemy@googlegroups.com. To unsubscribe from this group, send email to sqlalchemy+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/sqlalchemy?hl=en.