> the 0.4 pattern for using scoped_session is:
>
> session = scoped_session(sessionmaker(transactional=(True|False),
> autoflush=(True|False)))

defined globaly:
session = scoped_session(sessionmaker(transactional=True,
autoflush=False))

result:

Exception in thread Thread-3:
Traceback (most recent call last):
  File "threading.py", line 442, in __bootstrap
    self.run()
  File "./camper.py", line 116, in run
    walk(session, theone, root)
  File "./camper.py", line 79, in walk
    stuff =
session.query(Path).select_from(f_table.join(u_table)).filter(User.c.id==theone.id).filter(Path.c.path==relpath).first()
  File "/usr/lib/python2.4/site-packages/sqlalchemy/orm/query.py",
line 600, in first
    ret = list(self[0:1])
  File "/usr/lib/python2.4/site-packages/sqlalchemy/orm/query.py",
line 629, in __iter__
    return self._execute_and_instances(context)
  File "/usr/lib/python2.4/site-packages/sqlalchemy/orm/query.py",
line 632, in _execute_and_instances
    result = self.session.execute(querycontext.statement,
params=self._params, mapper=self.mapper)
  File "/usr/lib/python2.4/site-packages/sqlalchemy/orm/session.py",
line 527, in execute
    return self.__connection(engine,
close_with_result=True).execute(clause, params or {}, **kwargs)
  File "/usr/lib/python2.4/site-packages/sqlalchemy/orm/session.py",
line 509, in __connection
    return self.transaction.get_or_add(engine)
  File "/usr/lib/python2.4/site-packages/sqlalchemy/orm/session.py",
line 179, in get_or_add
    (conn, trans, autoclose) = self.__parent.__connections[bind]
KeyError: Engine(postgres://user:[EMAIL PROTECTED]/mydb)

> turning on transactional=True there is probably a good idea, as long
> as you commit() your changes expicitly and close out the session at
> the end of a web request (is this a web application ?)

this is a daemon
--~--~---------~--~----~------------~-------~--~----~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to