@contextmanager
    def transaction(self, session=None):
        local_session = None
        if session is None:
            local_session = session = self.create_scoped_session()
        try:
            yield session
        finally:
            # Since ``local_session`` was created locally, close it here itself
            if local_session is not None:
                # but wait!
                # http://groups.google.com/group/sqlalchemy/browse_thread/thread/7c1eb642435adde7
                # To workaround this issue with sqlalchemy, we can either:
                #  1) pass the session object explicitly
                #  2) do not close the session at all (bad idea - could lead to memory leaks)
                #
                # Till pypm implements atomic transations in client.installer,
                # we retain this hack (i.e., we choose (2) for now)
                pass # local_session.close()
Performs the query and returns a single object matching the given
dataset/ETHPy150Open ActiveState/applib/applib/_simpledb.py/SimpleDatabase.transaction--crossover with--dataset/ETHPy150Open charles-vdulac/django-roa/django_roa/db/query.py/RemoteQuerySet.get