Results 1 to 3 of 3
  1. #1
    Join Date
    Jul 2003
    Posts
    16

    Unanswered: @@trancount -- Storedprocedure

    Hi

    In my stored procedure the @@trancount results in 1
    as result of which i am not able to commit the transaction and face the following error
    Transaction count after EXECUTE indicates that a COMMIT or ROLLBACK TRAN is missing. Previous count = 0, Current count = 1.
    (return status = 0)

    as a result of which there is a pagelock and not able to do any further transactions.
    infact it hangs the system./database

    can any one tell me why do we get this error and what are the possible causes for the same
    and how can we rectify the same.

    In my stored procedure i have different transactions to update different tables.
    that would mean for updating each table i have one transaction

    Also one more query can we have different transaction names inorder to update the different tables, or should we can use the same name for all the transactions.

    please let me know ur inputs for the same

    Regards
    Shalu
    Regards
    Shalu

  2. #2
    Join Date
    Aug 2002
    Location
    Madrid, Spain
    Posts
    97

    Re: @@trancount -- Storedprocedure

    Originally posted by shalu_91
    In my stored procedure the @@trancount results in 1
    as result of which i am not able to commit the transaction and face the following error
    Transaction count after EXECUTE indicates that a COMMIT or ROLLBACK TRAN is missing. Previous count = 0, Current count = 1.
    (return status = 0)

    as a result of which there is a pagelock and not able to do any further transactions.
    infact it hangs the system./database

    can any one tell me why do we get this error and what are the possible causes for the same
    and how can we rectify the same.

    In my stored procedure i have different transactions to update different tables.
    that would mean for updating each table i have one transaction

    Also one more query can we have different transaction names inorder to update the different tables, or should we can use the same name for all the transactions.
    What ASE is assuming is that stored procedures don't
    leave opened transactions behind. That is, if a stored
    proc opens a tran, the same stored proc must close it
    (commit or rollback) before returning to its caller.

    Regards,
    Mariano Corral

  3. #3
    Join Date
    Jul 2003
    Posts
    16
    Thanks for the explanation
    i also found the following link explaining more abt this error

    http://manuals.sybase.com/onlinebook...TextView/14130

    I have resolved the problem
    In my stored proc i was checking for certain conditions after beginning the transaction and if the conditions did not satisfy i did not do anything neither commin nor rollback
    so i first checked the conditions if the conditions satisfy then only i do begin transaction and later commit or rollback based on the return status of the processing

    Regards
    Shalu
    Regards
    Shalu

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •