Revision 3160
Added by Aaron Marcuse-Kubitza over 12 years ago
lib/sql.py | ||
---|---|---|
392 | 392 |
top = self._savepoint == 0 |
393 | 393 |
savepoint = 'level_'+str(self._savepoint) |
394 | 394 |
|
395 |
# Must happen before running queries so they don't get autocommitted |
|
396 |
self._savepoint += 1 |
|
397 |
|
|
395 | 398 |
if top: query = 'START TRANSACTION ISOLATION LEVEL READ COMMITTED' |
396 | 399 |
else: query = 'SAVEPOINT '+savepoint |
397 | 400 |
self.run_query(query, log_level=4) |
398 |
|
|
399 |
self._savepoint += 1 |
|
400 | 401 |
try: |
401 | 402 |
return func() |
402 | 403 |
if top: self.run_query('COMMIT', log_level=4) |
Also available in: Unified diff
sql.py: DbConn.with_savepoint(): Increment _savepoint before running queries so they don't get autocommitted