[sqlalchemy] Outer transaction does not see changes from nested transaction - SA 0.5

2009-01-16 Thread Saju Pillai
Hi, I start a nested transaction and delete a object from the session and commit. The outer transaction does not see this delete. I tried to flush but that didn't help. session.begin_nested() session.delete(some_obj) session.commit() session.queryfor..some_obj finds it. 1. How can I get

[sqlalchemy] Re: Outer transaction does not see changes from nested transaction - SA 0.5

2009-01-16 Thread Michael Bayer
On Jan 16, 2009, at 3:18 AM, Saju Pillai wrote: Hi, I start a nested transaction and delete a object from the session and commit. The outer transaction does not see this delete. I tried to flush but that didn't help. session.begin_nested() session.delete(some_obj) session.commit()

[sqlalchemy] Migrating objects across sessions

2009-01-16 Thread Darren Govoni
Hi, I have an object (with references) I get from a session on database A and I want to copy it (deep copy) to database B. I tried expunging it from the first session and adding it to the second. What's the best practice to do this? thanks! Darren

[sqlalchemy] Order of INSERTs for children of an object

2009-01-16 Thread Tomasz Nazar
Hi. Let me explain problem I have with an order of insert statements created by SQLA which looks as random one. Inserts are generated for the root object, and its children obviously. Conference - ConferenceLang (one-to-many) Conference - Participant (one-to-many) code self.confs_t =

[sqlalchemy] Re: Order of INSERTs for children of an object

2009-01-16 Thread Michael Bayer
On Jan 16, 2009, at 6:13 PM, Tomasz Nazar wrote: Do I have control over this behaviour? Or am I doing sth wrong? Thanks for any help..Tomasz you can ! its an exposed internal API but its pretty stable for now. Build a SessionExtension like this: from sqlalchemy.orm.interfaces import

[sqlalchemy] Re: creating indexes in MySQL

2009-01-16 Thread KevinTran
Thanks so much. I am new to this whole SQL/database thing and this is the exact function I was looking for. On Jan 15, 1:59 pm, Michael Bayer mike...@zzzcomputing.com wrote: try using the DDL() construct instead.   I dont think Index() supports   that syntax. On Jan 15, 2009, at 3:10 PM,

[sqlalchemy] Re: utf8 encoding issue in MySQL

2009-01-16 Thread KevinTran
Thanks you. It worked. On Jan 15, 1:58 pm, Michael Bayer mike...@zzzcomputing.com wrote: I think this is configurable on the MySQL server directly, i.e.   default charset, otherwise you can set it via **{'mysql_DEFAULT   CHARSET':'utf8'} in your Table def. On Jan 15, 2009, at 3:17 PM,

[sqlalchemy] Re: Selecting from a self-referential mapper: recursive joins?

2009-01-16 Thread rich
Eric, Any additional conclusions to recursively querying your dependency graph? I just found SA, and have been wondering how feasible it would be to manage and query a graph structure somewhat similar to the one you've described. My problem is that I have a number of classes that build

[sqlalchemy] Re: Outer transaction does not see changes from nested transaction - SA 0.5

2009-01-16 Thread Saju Pillai
session.begin_nested() session.delete(some_obj) session.commit() session.queryfor..some_obj finds it. 1. How can I get the changes in the nested transaction to turn up in the outer transaction without having to commit the outer transaction. you should be getting the results