This article was created in response to a support issue logged with K2. The content may include typographical errors and may be revised at any time without notice This article is not considered official documentation for K2 software and is provided “as is” with no warranties.

Issue

When executing a SmartObject method that in turn executes an SQL Stored Procedure, the SmartObject returns the following error:

"Transaction count after EXECUTE indicates a mismatching number of BEGIN and COMMIT statements. Previous count = 1, current count = 0."

Image

Symptoms

  • This error only occurs after applying 4.7 November 2017 CU, or any CUs that were released after November 2017.
  • On 4.7 without any CU and FP applied, you may get an SQL transaction has completed; it is no longer usable error.
  • Stored procedure has nested transactions.
  • Stored procedure contains RAISERROR. Removing the RAISERROR in the stored procedure allows the SmartObject to be executed without any errors.

Troubleshooting Steps

To resolve this error, please do the following:
  1. Edit your SQL Server service instance.
  2. Set Suppress Transaction to true.

    Image

  3. Update the service instance.
  4. Refresh the SmartObject, and test the SmartObject again. The error should go away.

Please read more here for more information on Suppress Transaction.