Our Pylons setup emails every traceback error to our developers, &
with about 80 users, we've been getting a couple of hundred error
emails a day, almost all with this same error (Tomorrow we will have
about 1200 users on our system). The following is an excerpt of the
traceback message. Every error has at least these final lines of the
message in common:

Module sqlalchemy.orm.attributes:44 in __get__
<<          if instance is None:
                return self
            return self.impl.get(instance._state)

        def get_history(self, instance, **kwargs):>>  return
self.impl.get(instance._state)

Module sqlalchemy.orm.attributes:279 in get
<<                      if passive:
                            return PASSIVE_NORESULT
                        value = callable_()
                        if value is not ATTR_WAS_SET:
                            return self.set_committed_value(state,
value)>>  value = callable_()

Module sqlalchemy.orm.strategies:483 in __call__
<<          q = q.filter(strategy.lazy_clause(instance))

            result = q.all()
            if strategy.uselist:
                return result>>  result = q.all()

Module sqlalchemy.orm.query:860 in all
<<          This results in an execution of the underlying query.
            """
            return list(self)>>  return list(self)

Module sqlalchemy.orm.query:921 in __iter__
<<          if self._autoflush and not self._populate_existing:
                self.session._autoflush()
            return self._execute_and_instances(context)

        def _execute_and_instances(self, querycontext):>>  return
self._execute_and_instances(context)

Module sqlalchemy.orm.query:924 in _execute_and_instances
<<
        def _execute_and_instances(self, querycontext):
            result = self.session.execute(querycontext.statement,
params=self._params, mapper=self.mapper,
instance=self._refresh_instance)
            return self.iterate_instances(result,
querycontext=querycontext)>>  result =
self.session.execute(querycontext.statement, params=self._params,
mapper=self.mapper, instance=self._refresh_instance)

Module sqlalchemy.orm.session:605 in execute
<<          engine = self.get_bind(mapper, clause=clause, **kwargs)

            return self.__connection(engine,
close_with_result=True).execute(clause, params or {})

        def scalar(self, clause, params=None, mapper=None,
**kwargs):>>  return self.__connection(engine,
close_with_result=True).execute(clause, params or {})

Module sqlalchemy.engine.base:846 in execute
<<          for c in type(object).__mro__:
                if c in Connection.executors:
                    return Connection.executors[c](self, object,
multiparams, params)
            else:
                raise exceptions.InvalidRequestError("Unexecutable
object type: " + str(type(object)))>>  return Connection.executors[c]
(self, object, multiparams, params)

Module sqlalchemy.engine.base:897 in execute_clauseelement
<<          else:
                keys = None
            return
self._execute_compiled(elem.compile(dialect=self.dialect,
column_keys=keys, inline=len(params) > 1), distilled_params=params)

        def _execute_compiled(self, compiled, multiparams=None,
params=None, distilled_params=None):>>  return
self._execute_compiled(elem.compile(dialect=self.dialect,
column_keys=keys, inline=len(params) > 1), distilled_params=params)

Module sqlalchemy.engine.base:909 in _execute_compiled
<<
            context.pre_execution()
            self.__execute_raw(context)
            context.post_execution()
            self._autocommit(context)>>  self.__execute_raw(context)

Module sqlalchemy.engine.base:918 in __execute_raw
<<              self._cursor_executemany(context.cursor,
context.statement, context.parameters, context=context)
            else:
                self._cursor_execute(context.cursor,
context.statement, context.parameters[0], context=context)

        def _execute_ddl(self, ddl, params, multiparams):>>
self._cursor_execute(context.cursor, context.statement,
context.parameters[0], context=context)

Module sqlalchemy.engine.base:962 in _cursor_execute
<<              self.dialect.do_execute(cursor, statement, parameters,
context=context)
            except Exception, e:
                self._handle_dbapi_exception(e, statement, parameters,
cursor)
                raise
    >>  self._handle_dbapi_exception(e, statement, parameters, cursor)

Module sqlalchemy.engine.base:944 in _handle_dbapi_exception
<<                  if self.__close_with_result:
                        self.close()
                raise exceptions.DBAPIError.instance(statement,
parameters, e, connection_invalidated=is_disconnect)
            finally:
                del self._reentrant_error>>  raise
exceptions.DBAPIError.instance(statement, parameters, e,
connection_invalidated=is_disconnect)
DBAPIError: (Error) ('HY000', '[HY000] [Microsoft][SQL Native
Client]Connection is busy with results for another command (0)')
u'SELECT ...snip...'

I don't know whether this helps, but many thanks for looking at the
issue :)

On Apr 28, 11:27 am, "Rick Morrison" <[EMAIL PROTECTED]> wrote:
> > It is possible we could re-introduce "check for open cursors" as a
> > pool events extension.  It would raise an error if any connection is
> > returned with associated cursors still opened and could track down
> > issues like these.
>
> That would be a great diagnostic tool for this: It's hard to track down the
> issue now, as the problem doesn't show itself until the cursor is re-used on
> some later, unrelated query.
--~--~---------~--~----~------------~-------~--~----~
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