Skip to main content

Posts

Showing posts with the label ttsabort

ttsBegin and ttsCommit in MSD axapta

You can use ttsbegin and ttscommit with ttsabort following way. You can try in job public boolean myMethod() { try { ttsBegin; select forUpdate myTable; myTable.fname = testt_; myTable.update(); ttsCommit; } catch(exception::Error) { ttsabort; return(false); } return(true); }

Transactions in Axapta

Transactions in Axapta The X++ language supports three statements that you are probably well-acquainted with to support transactions when performing data manipulation in Axapta: • ttsBegin : Starts a transaction block • ttsCommit : Closes a transaction block and commits the data to the database • ttsAbort : Closes a transaction and rolls back all data manipulation within the current transaction block If data manipulation statements performing inserts, updates, or deletes are not enclosed in a transaction block, Axapta automatically commits with every insert, update, or delete statement. If Axapta terminates abnormally or exits with open transactions, then all transactions not committed explicitly or implicitly are rolled back automatically. It goes without saying that you should lock records that you select for updating by using the forUpdate keyword in X++ select statements.