True, but I was hoping to find something simple like the solution Mike posted 
:-)

Kevin

Thomas G. Willis wrote:
Well you could always look at the source for scoped_session :)

On Mon, Mar 22, 2010 at 7:18 PM, Kevin Wormington <[email protected]> wrote:
I'm not wanting to use sqlalchemy, just the low level database interface.  I
have a working example with sqlalchemy but I prefer to use the low level
interface so I need to make a db connection handle thread safe.  I don't
really care whether the connections are pooled.

Kevin

Thomas G. Willis wrote:
I believe in sqlalchemy scoped_session is used for this purpose.


http://www.sqlalchemy.org/docs/05/reference/orm/sessions.html#sqlalchemy.orm.scoped_session

example usage:

engine = engine_from_config(config)

session = scoped_session(
               sessionmaker(expire_on_commit = False,
                            bind = engine))



On Mon, Mar 22, 2010 at 6:43 PM, kworm <[email protected]> wrote:
Hi, I'm new to Pylons and Python for that matter and I'm looking for
the best way to handle thread safety for an ibm_db (DB2 CLI library
interface) database connection in a Pylons app.  I have seen several
older topics on this but not really a clear answer.  Any suggestions
would be appreciated.

Thanks,

Kevin

--
You received this message because you are subscribed to the Google Groups
"pylons-discuss" 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/pylons-discuss?hl=en.




--
You received this message because you are subscribed to the Google Groups
"pylons-discuss" 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/pylons-discuss?hl=en.






--
You received this message because you are subscribed to the Google Groups 
"pylons-discuss" 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/pylons-discuss?hl=en.

Reply via email to