Sets the default transaction timeout value in seconds, which is applied to all new transactions started after this time.
Note that this method changes the timeout for all future transactions for all users.
Example:
var originalTimeoutValue = system.transactionManager.defaultTransactionTimeout;
try {
system.transactionManager.setDefaultTransactionTimeout(3600);
// Start a new transaction with the new timeout value
system.transactionManager.commitAndRestartTransaction();
.. the rest of your code goes here
}
finally {
system.transactionManager.setDefaultTransactionTimeout(originalTimeoutValue);
}
Example: