[sqlalchemy] Re: Premature autoflushing leads to IntegrityError with AssociationProxy and a backref

2011-02-17 Thread Julien Demoor
: disable autoflush in the GroupOwner constructor.   Seehttp://www.sqlalchemy.org/trac/wiki/UsageRecipes/DisableAutoflush. On Feb 17, 2011, at 5:56 AM, Julien Demoor wrote: Hi, I'm running into a problem illustrated by the code below. The result is an IntegrityError

RE: [sqlalchemy] Cannot retrieve PostgreSQL array column with session.query() : TypeError: unhashable type: 'list'

2010-10-14 Thread Julien Demoor
unique_list(). I suppose we'd modify ARRAY to return tuples if it's mutable flag isn't set. that could only be in 0.7, though. Let me know if that works for you, we'll add a ticket (hard for me to say since I never use the ARRAY type). On Oct 13, 2010, at 2:22 PM, Julien Demoor wrote

RE: [sqlalchemy] Cannot retrieve PostgreSQL array column with session.query() : TypeError: unhashable type: 'list'

2010-10-14 Thread Julien Demoor
the ARRAY type). On Oct 13, 2010, at 2:22 PM, Julien Demoor wrote: Hello, The problem I'm seeing is illustrated by the code below. I tried a workaround using TypeDecorator with process_result_value returning a tuple rather than a list, to no avail. Any help will be greatly

RE: [sqlalchemy] Cannot retrieve PostgreSQL array column with session.query() : TypeError: unhashable type: 'list'

2010-10-14 Thread Julien Demoor
with session.query() : TypeError: unhashable type: 'list' On Oct 14, 2010, at 11:53 AM, Julien Demoor wrote: Thanks again for your help. I had tried using TypeDecorator without success. Now I tested further and found the problem is more narrow in scope than I thought. If I create a table MyTable

[sqlalchemy] Cannot retrieve PostgreSQL array column with session.query() : TypeError: unhashable type: 'list'

2010-10-13 Thread Julien Demoor
Hello, The problem I'm seeing is illustrated by the code below. I tried a workaround using TypeDecorator with process_result_value returning a tuple rather than a list, to no avail. Any help will be greatly appreciated. Regards. Traceback : Traceback (most recent call last): File

[sqlalchemy] Session uses new connection after commit

2010-08-24 Thread Julien Demoor
Hi, I'm using PostgreSQL advisory locks in a multithreaded program. Worker threads acquire locks with session.execute(select([func.pg_advisory_lock(key)])) during a transaction and release them just after session.commit(). Sometimes however, the connection behind the thread's session will have

[sqlalchemy] Re: Session uses new connection after commit

2010-08-24 Thread Julien Demoor
Thanks a lot, that solves my problem. Also it seems to work well without instantiating the scoped session, so this is perfect. On Aug 24, 3:13 pm, Michael Bayer mike...@zzzcomputing.com wrote: On Aug 24, 2010, at 6:12 AM, Julien Demoor wrote: Hi, I'm using PostgreSQL advisory locks

[sqlalchemy] Joined subquery, SQL syntax error

2009-07-16 Thread Julien Demoor
Hello, I have a query that fails when executed: the engine is passed the string representation of a sqlalchemy.sql.expression._BinaryExpression object as a parameter, resulting in a syntax error. This expression is part of a subquery which is joined to a table. There is a simplified exemple