[sqlalchemy] Inserting when the row depends on id generated by the same transaction.

2012-01-03 Thread Thiago de Arruda
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

Re: [sqlalchemy] Inserting when the row depends on id generated by the same transaction.

2012-01-03 Thread Michael Bayer
On Jan 3, 2012, at 9:52 AM, Thiago de Arruda wrote: 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

Re: [sqlalchemy] Inserting when the row depends on id generated by the same transaction.

2012-01-03 Thread Thiago Padilha
On Tue, Jan 3, 2012 at 1:18 PM, Michael Bayer mike...@zzzcomputing.com wrote: Not sure what the issue is for the first aspect here, do you just need to call Session.flush() ?   http://www.sqlalchemy.org/docs/orm/session.html#flushing That's exactly what I need to do :) This is a common

Re: [sqlalchemy] Inserting when the row depends on id generated by the same transaction.

2012-01-03 Thread Michael Bayer
On Jan 3, 2012, at 1:17 PM, Thiago Padilha wrote: It's nice to see sqlalchemy provides a way to hold database locks. This is a good option but my customer didn't like this since he believes his system will be highly concurrent. I will just use another temporary table for fast