DataBase Transactions

  • Create New Transactions 

 Trx trx = Trx.Get("del_");  

OR 

Trx trx = Trx.Get(Trx.CreateTrxName("del_")); //Return unique name 

 

  • Pass Transaction 

int result =  DB.ExecuteQuery("Delete From Test Where ID = 1000023", null, trx) >0; 

 

  • Commit or RollBack 

if(result >0) 

     trx.Commit(); 

else  

    trx.Rollback(); 

  

//must close trx 

   trx.Close();