| 408 | | except (cherrypy.HTTPRedirect, cherrypy.InternalRedirect): |
|---|
| 409 | | log.debug('this is only a redirect') |
|---|
| 410 | | # If a redirect happens; commit and proceed with redirect |
|---|
| | 410 | except (cherrypy.HTTPRedirect, cherrypy.InternalRedirect): |
|---|
| | 411 | log.debug('this is only a redirect') |
|---|
| | 412 | # If a redirect happens; commit and proceed with redirect |
|---|
| | 413 | if sa_tr_active(req.sa_transaction): |
|---|
| | 414 | req.sa_transaction.commit() |
|---|
| | 415 | raise |
|---|
| | 416 | |
|---|
| | 417 | except: |
|---|
| | 418 | log.debug('this is an exception, ROLLBACK now!') |
|---|
| | 419 | # If any other exception happens; rollback and re-raise error |
|---|
| | 420 | if sa_tr_active(req.sa_transaction): |
|---|
| | 421 | req.sa_transaction.rollback() |
|---|
| | 422 | raise |
|---|
| | 423 | |
|---|
| | 424 | # If the call was successful; commit and proceed |
|---|
| 415 | | except: |
|---|
| 416 | | log.debug('this is an exception, ROLLBACK now!') |
|---|
| 417 | | # If any other exception happens; rollback and re-raise error |
|---|
| 418 | | if sa_tr_active(req.sa_transaction): |
|---|
| 419 | | req.sa_transaction.rollback() |
|---|
| 420 | | raise |
|---|
| 421 | | |
|---|
| 422 | | # If the call was successful; commit and proceed |
|---|
| 423 | | if sa_tr_active(req.sa_transaction): |
|---|
| 424 | | log.debug('The transaction was successful, COMMIT now!') |
|---|
| 425 | | req.sa_transaction.commit() |
|---|
| 426 | | |
|---|