none
Uncommittable transaction is detected at the end of the batch. RRS feed

  • Question

  • Hi Friends,

                 I got some error when my window service is run.

    I have a web service which is used to insert the orders in table and get the records which is recently added in table. I am using Transaction in front end(i.e. for front end) . It is work fine but i got the error log after successful insert ....

    Message: System.Data.SqlClient.SqlException: Uncommittable transaction is detected at the end of the batch. The transaction is rolled back.
       at Microsoft.VisualBasic.CompilerServices.Symbols.Container.InvokeMethod(Method TargetProcedure, Object[] Arguments, Boolean[] CopyBack, BindingFlags Flags)
       at Microsoft.VisualBasic.CompilerServices.NewLateBinding.LateGet(Object Instance, Type Type, String MemberName, Object[] Arguments, String[] ArgumentNames, Type[] TypeArguments, Boolean[] CopyBack)
       at WDS.SIKBLL.ImplementBLL.CheckDataBLL(String header, Int32 customerAccount, Int32 orderNumber, String customerName, DateTime startBillingDate, DateTime shipDate, String orderType, String orderComment, String saleReason, String saleType, DateTime saleDate, String saleRepresentatorID, String technicianID, String serviceCode, String serviceCategoryCode, Int32 callCode, Int32 noOfNewEquipments, String address1, String address2, String city, String state, String postalCode, String phoneNumber, String emailAddress, String serviceType, String signature, String returnAddress1, String returnAddress2, String returnCity, String returnState, String returnPostalCode, String returnPhoneNumber, String returnEmailAddress, String headEnd)
       at WDS.SIK.SIK.SIK_DataService(Int32 customerAccount, Int32 orderNumber, String customerName, DateTime startBillingDate, DateTime shipDate, String orderType, String orderComment, String saleReason, String saleType, DateTime saleDate, String saleRepresentatorID, String technicianID, String serviceCode, String serviceCategoryCode, Int32 callCode, Int32 noOfNewEquipments, String address1, String address2, String city, String state, String postalCode, String phoneNumber, String emailAddress, String returnAddress1, String returnAddress2, String returnCity, String returnState, String returnPostalCode, String returnPhoneNumber, String returnEmailAddress, String headEnd)
    Category: Error

    Code Is 

                 

      Using tran As New TransactionScope()
                Try

                     retDisplayVal = ObjImplementBLL.CheckDataBLL(header, customerAccount, orderNumber, customerName,startBillingDate,   shipDate, orderType, orderComment, saleReason, saleType, saleDate, saleRepresentatorID, technicianID, serviceCode, serviceCategoryCode, callCode, noOfNewEquipments, address1,address2, city, state, postalCode, phoneNumber, emailAddress, serviceType, signature, returnAddress1, returnAddress2, returnCity, returnState, returnPostalCode, returnPhoneNumber, returnEmailAddress, headEnd)

       If retDisplayVal.Tables(0).Rows.Count > 0 Then

                                If retDisplayVal.Tables(0).Rows.Item(0).Item(0).ToString() = "1" Then
                                    dt = retDisplayVal.Tables(1)
                                    messageData = Resources.SIK_Resource.SuccessfulMsg
                                ElseIf retDisplayVal.Tables(0).Rows.Item(0).Item(0).ToString() = "2" Then
                                    messageData = Resources.SIK_Resource.ErrorMsg
                                ElseIf retDisplayVal.Tables(0).Rows.Item(0).Item(0).ToString() = "3" Then
                                    messageData = Resources.SIK_Resource.RequiredMsg
                                End If
                            End If

                    tran.Complete()

    Catch ex As Exception

                    messageData = Resources.SIK_Resource.ErrorMsg

    end Try

    How i resolve it, please help me...


    sonesh


    Wednesday, March 19, 2014 11:17 AM

Answers

  • Hi,
    >>Message: System.Data.SqlClient.SqlException: Uncommittable transaction is detected at the end of the batch

    The error that ordinarily ends a transaction outside a TRY block causes a transaction to enter an uncommittable state when the error occurs inside a TRY block. An uncommittable transaction can only perform read operations or a ROLLBACK TRANSACTION. The transaction cannot execute any Transact-SQL statements that would generate a write operation or a COMMIT TRANSACTION. The XACT_STATE function returns a value of -1 if a transaction has been classified as an uncommittable transaction. When a batch finishes, the Database Engine rolls back any active uncommittable transactions. If no error message was sent when the transaction entered an uncommittable state, when the batch finishes, an error message will be sent to the client application. This indicates that an uncommittable transaction was detected and rolled back.

    For geting more error information, please try to refer to:

    #Configuring Tracing:
    http://msdn.microsoft.com/en-us/library/ms733025(v=vs.110).aspx.

    Also please try to use the  Fiddler, a web debugging proxy with a WCF Binary Inspector. This will show you all the requests are being made and will show you what error code, and possibly what error is being returned by your service.

    Best Regards,
    Amy Peng


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Friday, March 21, 2014 8:16 AM
    Moderator