Am 09.03.2010 um 17:17 schrieb rajasekhar911:

Hi

i am not sure if this is an issue related to turbogears or sqlalchemy.

if i try to access a property of an object after doing a
transaction.commit() i get this UnboundExecutionError

UnboundExecutionError: Parent instance <User at 0x9a29b10> is not
bound to a Session; lazy load operation of attribute 'config' cannot
proceed

I have to do transaction.commit() to update the database immediately
so that other requests to this
object will get the updated value.

No, you don't. That's what DBSession.flush() is for. As you claim it's not working, there might be something wrong with your model-setup.


Try setting the engine to debug-mode via

  engine.echo = True

in your setup so that you can see what SQL is produced. If on flush nothing happens, you need to investigate - I have seen problems with this when different sessions are used involuntarily.

Diez

--
You received this message because you are subscribed to the Google Groups 
"TurboGears" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/turbogears?hl=en.

Reply via email to