A Data Engineer ran a stored procedure containing various transactions During the execution, the session abruptly disconnected preventing one transaction from committing or rolling hark. The transaction was left in a detached state and created a lock on resources
...must the Engineer take to immediately run a new transaction?
- Call the system function SYSTEM$ABORT_TRANSACTION.
- Call the system function SYSTEM$CANCEL_TRANSACTION.
- Set the LOCK_TIMEOUT to FALSE in the stored procedure
- Set the transaction abort on error to true in the stored procedure.
Answer(s): A
Explanation:
The system function SYSTEM$ABORT_TRANSACTION can be used to abort a detached transaction that was left in an open state due to a session disconnect or termination. The function takes one argument: the transaction ID of the detached transaction. The function will abort the transaction and release any locks held by it. The other options are incorrect because they do not address the issue of a detached transaction. The system function SYSTEM$CANCEL_TRANSACTION can be used to cancel a running transaction, but not a detached one. The LOCK_TIMEOUT parameter can be used to set a timeout period for acquiring locks on resources, but it does not affect existing locks. The TRANSACTION_ABORT_ON_ERROR parameter can be used to control whether a transaction should abort or continue when an error occurs, but it does not affect detached transactions.
Reveal Solution Next Question