Page 1 of 1

What can i do if InTransaction can't open

Posted: Thu 28 Jul 2022 17:31
by roky009
Hello,

When i check InTransaction, if it fails then what can i do?
can i do Rollback?
the codes are as follows:
thank you in advance:

Code: Select all

if(!UniQuery1->Connection->InTransaction)
{
   UniQuery1->Connection->AutoCommit = false;
   UniQuery1->Connection->StartTransaction(); 
   ...........
}
else{
    UniQuery1->Connection->Rollback();  
}

UniQuery1->Connection->AutoCommit = true;

Re: What can i do if InTransaction can't open

Posted: Tue 02 Aug 2022 07:50
by dzhanhira

Re: What can i do if InTransaction can't open

Posted: Mon 08 Aug 2022 01:22
by handsome
As far as I know, the original cause of the errors listed above is cross-database transaction related to the system resource database, this fix should solve it. Users may sometimes see the errors listed above along with the same underlying cause, the conditions under which this fix applies:
1. Databases that are part of an Always-Available Group enabled WITH DTC_SUPPORT = PER_DB.
2. A cross-database transaction involves this database and the SQL Server Edition system resource database.
3. Inside a cross-database transaction, SAVE TRANSACTION is used or joined in memory-optimized tables.
4. See more at run 3