I'm having issues with the sqlalchemy session and completely realize this is 
from my own lack of understanding but can't seem to find a solution.  My plan 
was to create a library with functions like so...

def func1 (id, session=None):
        result = <do somework>
        session.add(something)
        return result

def func2 (id, session=None):
        result = <do somework>
        session.add(something)
        return result

then from someplace else use the functions like so...

session = scoped_session()
result = func1(1, session)
result2=func2(2, session)
session.commit()
session.close()

This doesn't work though.  Do I need to return the session for something like 
this to work?  Any advice on the correct pattern to use when trying to create a 
transaction across several functions?

Thanks,
Brent

-- 
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To post to this group, send email to sqlalchemy@googlegroups.com.
To unsubscribe from this group, send email to 
sqlalchemy+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en.

Reply via email to