~lifeless/storm/bug-618019

« back to all changes in this revision

Viewing changes to storm/database.py

  • Committer: Robert Collins
  • Date: 2010-09-07 02:55:44 UTC
  • Revision ID: robert@canonical.com-20100907025544-oasr77kco33c25zy
Trace all raw cursor fetches.

Show diffs side-by-side

added added

removed removed

Lines of Context:
82
82
 
83
83
        @return: A converted row or None, if no data is left.
84
84
        """
85
 
        row = self._connection._check_disconnect(self._raw_cursor.fetchone)
 
85
        trace("raw_cursor_fetchone_before", self)
 
86
        try:
 
87
            row = self._connection._check_disconnect(self._raw_cursor.fetchone)
 
88
        finally:
 
89
            trace("raw_cursor_fetchone_after", self)
86
90
        if row is not None:
87
91
            return tuple(self.from_database(row))
88
92
        return None
96
100
        @raise DisconnectionError: Raised when the connection is lost.
97
101
            Reconnection happens automatically on rollback.
98
102
        """
99
 
        result = self._connection._check_disconnect(self._raw_cursor.fetchall)
 
103
        trace("raw_cursor_fetchall_before", self)
 
104
        try:
 
105
            result = self._connection._check_disconnect(
 
106
                self._raw_cursor.fetchall)
 
107
        finally:
 
108
            trace("raw_cursor_fetchall_after", self)
100
109
        if result:
101
110
            return [tuple(self.from_database(row)) for row in result]
102
111
        return result