Repository navigation
|
Given this:
and this:
Should we always use transaction blocks?
Or does using the cursor context manager do the same thing? |
Replies: 1 comment
|
The cursor context manager doesn't handle a transaction. If you want to handle the transaction as a block you can use |
The cursor context manager doesn't handle a transaction.
If you want to handle the transaction as a block you can use
conn.transaction(), otherwise you can useconn.commit()andconn.rollback().