@reconnecting()<EOL><INDENT>def _get_query(self, callback, schema, query=None, *args, **kwargs):<DEDENT>
if not query: query = Query()<EOL>ret = None<EOL>with self.connection(**kwargs) as connection:<EOL><INDENT>kwargs['<STR_LIT>'] = connection<EOL>try:<EOL><INDENT>if connection.in_transaction():<EOL><INDENT>with self.transaction(**kwargs):<EOL><INDENT>ret = callback(schema, query, *args, **kwargs)<EOL><DEDENT><DEDENT>else:<EOL><INDENT>ret = callback(schema, query, *args, **kwargs)<EOL><DEDENT><DEDENT>except Exception as e:<EOL><INDENT>exc_info = sys.exc_info()<EOL>if self.handle_error(schema, e, **kwargs):<EOL><INDENT>ret = callback(schema, query, *args, **kwargs)<EOL><DEDENT>else:<EOL><INDENT>self.raise_error(e, exc_info)<EOL><DEDENT><DEDENT><DEDENT>return ret<EOL>
this is just a common wrapper around all the get queries since they are
        all really similar in how they execute