Uploaded image for project: 'Railo'
  1. Railo
  2. RAILO-1390

Datasource option to re-issue a deadlocked query

    Details

    • Type: Feature Request
    • Status: Open (View Workflow)
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Labels:
      None

      Description

      Pasted from my mail to the Railo team:
      ----------------------------------------------
      ..I had to look into some Sql server errors which occured in one of our cfml/Railo apps. It is the famous "Transaction (Process ID 53) was deadlocked on lock resources with another process and has been chosen as the deadlock victim. Rerun the transaction."

      Now, since I did not have a try/catch around the cfquery tag where this error occured (it could happen with any query of any type), there is no way for me to "rerun the transaction", except for the user to reload the page.
      I can explain why this error really sucks, but let's just say an average programmer can not do much about it, without using "read uncommitted" (or "with(updlock)") everywhere in his code. Which would make the code un-portable to other database types btw.

      My suggestion here is to add a new option to the sql server datasource update screen: "times to re-issue a deadlocked query", with a value from 0 to .. euh... 5? With 0 being the default off course.
      Then, Railo could check a returned DB error to see if it is NativeErrorCode 1205. If so, and the retry-count is not yet maxed out, then write the error msg to a log file, and rerun the sql transaction.

      As I see it, this could be a killer feature for heavy sql server users, who wish to not pollute each and every select statement with "read uncommitted" statement.
      ----------------------------------------------

      I am not sure if these deadlock errors could also be caught for other database types; if so, then we could add it there too.

        Gliffy Diagrams

          Attachments

            Activity

              People

              • Assignee:
                micstriit Michael Offner
                Reporter:
                frinky Paul Klinkenberg
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated: