Re: [sqlalchemy] Using session.execute to bulk-insert into MySQL

2013-10-01 Thread Roman Iten
On 01.10.2013 09:08, Wichert Akkerman wrote: But the transaction is not committed. I discovered that the transaction is committed only if I call add() on DBSession (all five shots are inserted then)… That is expected behaviour: zope.sqlalchemy can only detect changes when you use the ORM. If

Re: [sqlalchemy] Re: Using session.execute to bulk-insert into MySQL

2013-09-30 Thread Roman Iten
In a nutshell -- the call to execute isn't touching the ORM level; just the sqlalchemy core. As such, it's not marking things as changed. Not sure why a rollback is preferred to no activity, but my guess would be it's easier on replication. According to the log, the transaction is neither

[sqlalchemy] Using session.execute to bulk-insert into MySQL

2013-09-29 Thread Roman Iten
Hi I started a pyramid project using the alchemy scaffold (includes ZopeTransactionExtension to scope sessions to requests, see [1]). Trying to insert many 'shots' into a MySQL database with a single SQL statement, I implemented the following view: DBSession = scoped_session(