[sqlalchemy] Re: Conflicting state in identity map?

2011-05-20 Thread Adrian
Ok, I'll definitely do some quality debugging... Just to be clear -- I **don't** have to worry about closing my sessions in each controller? On May 20, 6:08 pm, Michael Bayer wrote: > On May 20, 2011, at 4:12 PM, Adrian wrote: > > > So if it is the latter, that the Session is being shared amongs

Re: [sqlalchemy] SQLAlchemy 0.7.0 Released

2011-05-20 Thread Israel Ben Guilherme Fonseca
May the force be with SQLAlchemy. :) 2011/5/20 Michael Bayer > The SQLAlchemy project is pleased to announce version 0.7.0 of SQLAlchemy, > the first production release within the 0.7.0 series. 0.7 represents the > past year's worth of development, streamlining APIs, adding new features, > soli

[sqlalchemy] SQLAlchemy 0.7.0 Released

2011-05-20 Thread Michael Bayer
The SQLAlchemy project is pleased to announce version 0.7.0 of SQLAlchemy, the first production release within the 0.7.0 series. 0.7 represents the past year's worth of development, streamlining APIs, adding new features, solidifying the core and improving performance. Key highlights of version

Re: [sqlalchemy] Re: Conflicting state in identity map?

2011-05-20 Thread Michael Bayer
On May 20, 2011, at 4:12 PM, Adrian wrote: > So if it is the latter, that the Session is being shared amongst > threads, what is the correct way to handle the sessions from within > Turbogears? What I do now is create a scoped_session in the model, and > import it into each controller. For a whil

Re: [sqlalchemy] ORA-01461 on insert/update to String column

2011-05-20 Thread Michael Bayer
On the most recent versions of cx Oracle you need to have the NLS_LANG environment variable set for proper unicode handling. They temporarily made this step optional in the 5.0 series but they backtracked on that in 5.1. If that doesn't fix the issue then check on the cx_oracle list, as you sho

[sqlalchemy] Re: Conflicting state in identity map?

2011-05-20 Thread Adrian
So if it is the latter, that the Session is being shared amongst threads, what is the correct way to handle the sessions from within Turbogears? What I do now is create a scoped_session in the model, and import it into each controller. For a while, I made use of special functions _before() and _aft

[sqlalchemy] ORA-01461 on insert/update to String column

2011-05-20 Thread Rodney Barnett
I have a table in Oracle (10gXE) that has a VARCHAR2 (4000) column. Whenever I try to specify a value for the column that has more 2000 characters using a python Unicode variable, I get "ORA-01461: can bind a LONG value only for insert into a LONG column". When I explicitly encode this into a utf-

Re: [sqlalchemy] Conflicting state in identity map?

2011-05-20 Thread Michael Bayer
On May 20, 2011, at 9:45 AM, Adrian wrote: > I have a Turbogears server that uses sqlalchemy to interface with a > postgres database. Today, I noticed the server was down, so I tried > restarting it. Now my turbogears log is full of errors like: > AssertionError: A conflicting state is already pr

[sqlalchemy] Conflicting state in identity map?

2011-05-20 Thread Adrian
I have a Turbogears server that uses sqlalchemy to interface with a postgres database. Today, I noticed the server was down, so I tried restarting it. Now my turbogears log is full of errors like: AssertionError: A conflicting state is already present in the identity map for key (, (1045,)) and Exc

Re: [sqlalchemy] Re: creating tables and mappers multiple times in the same python script

2011-05-20 Thread Michael Bayer
On May 20, 2011, at 4:48 AM, Faheem Mitha wrote: > On Fri, 20 May 2011 00:52:28 -0400, Michael Bayer > wrote: >> >> On May 19, 2011, at 5:24 PM, Faheem Mitha wrote: > >>> Unfortunately, that is not true. (So I guess just leaving the >>> structure alone and switching dbs will not work.) There

[sqlalchemy] Re: creating tables and mappers multiple times in the same python script

2011-05-20 Thread Faheem Mitha
On Fri, 20 May 2011 00:52:28 -0400, Michael Bayer wrote: > > On May 19, 2011, at 5:24 PM, Faheem Mitha wrote: >> Unfortunately, that is not true. (So I guess just leaving the >> structure alone and switching dbs will not work.) There are 4 >> possible different database layouts. Also, there can