I've an issue I haven't been able to figure out just yet and I'm hoping 
to gain some insight.  I have a simple script that adds child records to 
a parent like so:

new_child = Child()
new_child.name = 'test'
parent.append(child)

Here is the weird part.  On the dev machine it works fine.  On the 
production machine, I get an error about new_child already being 
attached to a session so parent and new child are in different sessions. 
  I'm running the same version of SA on both machines.  Doing some 
introspection I found this:

On the dev machine:
     object_session(new_child) == None

On production:
     object_session(new_child) == <sqlalchemy.orm.session.Session object 
at 0x40a3c3ac>

When I create new_child on production, it is automatically attached to a 
session.  What would cause this?

Randall


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Sqlalchemy-users mailing list
Sqlalchemy-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sqlalchemy-users

Reply via email to