[sqlalchemy] Dialects supporting autocommit in the current session

2016-09-26 Thread Mark Sandan
Hi, I was wondering if there exists a dialect-wide way to query whether the underlying database is in a transaction mode that requires an autocommit or not. In Teradata, there is this notion of a transaction mode. When a session in Teradata is in a certain transaction mode (TDBS), autocommits

Re: [sqlalchemy] examples/versioned_history/history_meta.py Coalescing changes to produce a single history insert

2016-09-26 Thread Mike Bayer
Seems that way. Careful testing will as always confirm the methodology and implementation. On 09/26/2016 06:29 PM, HP3 wrote: Thank you! So, the following is all true? Recap'ing the solution (Jason's and yours combined): 1- On `after_flush`, call `history_meta.create_version()`

Re: [sqlalchemy] examples/versioned_history/history_meta.py Coalescing changes to produce a single history insert

2016-09-26 Thread HP3
Agreed! Thank you very much again! -- You received this message because you are subscribed to the Google Groups "sqlalchemy" group. To unsubscribe from this group and stop receiving emails from it, send an email to sqlalchemy+unsubscr...@googlegroups.com. To post to this group, send email to

Re: [sqlalchemy] examples/versioned_history/history_meta.py Coalescing changes to produce a single history insert

2016-09-26 Thread HP3
Thank you! So, the following is all true? Recap'ing the solution (Jason's and yours combined): 1- On `after_flush`, call `history_meta.create_version()` for each object that is changing so its `XYZHistory` instance is created and can be stored within `session.info`. 2. On `before_commit`, do

Re: [sqlalchemy] alternate ways to removing event listeners?

2016-09-26 Thread Mike Bayer
On 09/26/2016 02:39 PM, Iain Duncan wrote: Hi folks, I'm having an issue with event listener registration. I figured out that I need to deregister my listeners after each functional test so they don't get registered twice in the same thread and execute too many times. But I was using an

[sqlalchemy] alternate ways to removing event listeners?

2016-09-26 Thread Iain Duncan
Hi folks, I'm having an issue with event listener registration. I figured out that I need to deregister my listeners after each functional test so they don't get registered twice in the same thread and execute too many times. But I was using an anonymous callable to register them, like this:

Re: [sqlalchemy] examples/versioned_history/history_meta.py Coalescing changes to produce a single history insert

2016-09-26 Thread Mike Bayer
On 09/26/2016 01:24 PM, HP3 wrote: It seems like 0.9 does not have 'parent' in `SessionTransaction`. Instead, it has `_parent`. Would `_parent` suffice? yes, use _parent. i pushed up docs to 1.0 and 1.1 which indicate that _parent is the original attribute in the absense of .parent.

Re: [sqlalchemy] examples/versioned_history/history_meta.py Coalescing changes to produce a single history insert

2016-09-26 Thread HP3
It seems like 0.9 does not have 'parent' in `SessionTransaction`. Instead, it has `_parent`. Would `_parent` suffice? On Monday, September 26, 2016 at 12:09:55 PM UTC-5, HP3 wrote: > > Thank you Mike, > > So basically, I should move the cleanup from > `after_commit`/`after_rollback` to

Re: [sqlalchemy] examples/versioned_history/history_meta.py Coalescing changes to produce a single history insert

2016-09-26 Thread HP3
Thank you Mike, So basically, I should move the cleanup from `after_commit`/`after_rollback` to `after_transaction_end` and do it **only** if `transaction.parent is None`? Recap'ing the solution (Jason's and yours combined): 1- On `after_flush`, call `history_meta.create_version()` for each

Re: [sqlalchemy] How to bulk-insert millions of values into Oracle

2016-09-26 Thread Seth P
Thanks. I guess my confusion is that the example at http://docs.sqlalchemy.org/en/latest/core/tutorial.html#executing-multiple-statements uses an array of dictionaries, not of unlabeled tuples. Meanwhile I ended up using Oracle's sqlldr, which seems to get the job done, though is much more