(self)
| 193 | threadData.inTransaction = True |
| 194 | |
| 195 | def endTransaction(self): |
| 196 | threadData = getCurrentThreadData() |
| 197 | if threadData.inTransaction: |
| 198 | retries = 0 |
| 199 | while retries < HASHDB_END_TRANSACTION_RETRIES: |
| 200 | try: |
| 201 | self.cursor.execute("END TRANSACTION") |
| 202 | threadData.inTransaction = False |
| 203 | except sqlite3.OperationalError: |
| 204 | pass |
| 205 | except sqlite3.ProgrammingError: |
| 206 | self.cursor = None |
| 207 | threadData.inTransaction = False |
| 208 | return |
| 209 | else: |
| 210 | return |
| 211 | |
| 212 | retries += 1 |
| 213 | time.sleep(1) |
| 214 | |
| 215 | try: |
| 216 | self.cursor.execute("ROLLBACK TRANSACTION") |
| 217 | except sqlite3.OperationalError: |
| 218 | self.cursor.close() |
| 219 | self.cursor = None |
| 220 | finally: |
| 221 | threadData.inTransaction = False |
no test coverage detected