Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Other Discussions
  3. The Weird and The Wonderful
  4. Best practices for transaction management,

Best practices for transaction management,

Scheduled Pinned Locked Moved The Weird and The Wonderful
announcementcom
8 Posts 7 Posters 45 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • P Offline
    P Offline
    Pete OHanlon
    wrote on last edited by
    #1

    Well - just got this code into review (this is the pseudocode version of a 2000 line routine - a coding WTF in its own right):

    1. Begin Transaction
    2.  Update Table 1 with a single value
    3.  Update Table 1 with another value - to the same row as step 2.
    4.  Pop up message box to ask user to ring somebody to confirm that it is OK to continue.
    5.  Update Table 2
    6. Commit Transaction
    

    The best bit is that the person who coded this, (supposedly an experienced developer), couldn't see that step 4a. User goes out for lunch, means that the transaction could effectively run for an hour or so.

    Please visit http://www.readytogiveup.com/ and do something special today. Deja View - the feeling that you've seen this post before.

    S V _ K R 5 Replies Last reply
    0
    • P Pete OHanlon

      Well - just got this code into review (this is the pseudocode version of a 2000 line routine - a coding WTF in its own right):

      1. Begin Transaction
      2.  Update Table 1 with a single value
      3.  Update Table 1 with another value - to the same row as step 2.
      4.  Pop up message box to ask user to ring somebody to confirm that it is OK to continue.
      5.  Update Table 2
      6. Commit Transaction
      

      The best bit is that the person who coded this, (supposedly an experienced developer), couldn't see that step 4a. User goes out for lunch, means that the transaction could effectively run for an hour or so.

      Please visit http://www.readytogiveup.com/ and do something special today. Deja View - the feeling that you've seen this post before.

      S Offline
      S Offline
      Sylvester george
      wrote on last edited by
      #2

      Pete O`Hanlon wrote:

      Pop up message box to ask user to ring somebody to confirm that it is OK to continue.

      Ohhh:((.....Thats what called User confirmation:).....I thought something different....:laugh:

      Regards, Sylvester G

      1 Reply Last reply
      0
      • P Pete OHanlon

        Well - just got this code into review (this is the pseudocode version of a 2000 line routine - a coding WTF in its own right):

        1. Begin Transaction
        2.  Update Table 1 with a single value
        3.  Update Table 1 with another value - to the same row as step 2.
        4.  Pop up message box to ask user to ring somebody to confirm that it is OK to continue.
        5.  Update Table 2
        6. Commit Transaction
        

        The best bit is that the person who coded this, (supposedly an experienced developer), couldn't see that step 4a. User goes out for lunch, means that the transaction could effectively run for an hour or so.

        Please visit http://www.readytogiveup.com/ and do something special today. Deja View - the feeling that you've seen this post before.

        V Offline
        V Offline
        Vikram A Punathambekar
        wrote on last edited by
        #3

        If this transaction wasn't started by the user in some way, imagine if the user went on a holiday. Or quit. :omg:

        Cheers, Vıkram.


        After all is said and done, much is said and little is done.

        1 Reply Last reply
        0
        • P Pete OHanlon

          Well - just got this code into review (this is the pseudocode version of a 2000 line routine - a coding WTF in its own right):

          1. Begin Transaction
          2.  Update Table 1 with a single value
          3.  Update Table 1 with another value - to the same row as step 2.
          4.  Pop up message box to ask user to ring somebody to confirm that it is OK to continue.
          5.  Update Table 2
          6. Commit Transaction
          

          The best bit is that the person who coded this, (supposedly an experienced developer), couldn't see that step 4a. User goes out for lunch, means that the transaction could effectively run for an hour or so.

          Please visit http://www.readytogiveup.com/ and do something special today. Deja View - the feeling that you've seen this post before.

          _ Offline
          _ Offline
          _Damian S_
          wrote on last edited by
          #4

          Begin Transaction 1. Fire contractor 2. Throw out code 3. Rewrite System Commit

          ------------------------------------------- Damian - Insert snappy one-liner here.

          D P 2 Replies Last reply
          0
          • _ _Damian S_

            Begin Transaction 1. Fire contractor 2. Throw out code 3. Rewrite System Commit

            ------------------------------------------- Damian - Insert snappy one-liner here.

            D Offline
            D Offline
            Dan Neely
            wrote on last edited by
            #5

            More likely... Begin transaction Hire new outsourcing firm Add more tentacles to existing Codethulu Commit self to mental hospital

            -- You have to explain to them [VB coders] what you mean by "typed". their first response is likely to be something like, "Of course my code is typed. Do you think i magically project it onto the screen with the power of my mind?" --- John Simmons / outlaw programmer

            1 Reply Last reply
            0
            • _ _Damian S_

              Begin Transaction 1. Fire contractor 2. Throw out code 3. Rewrite System Commit

              ------------------------------------------- Damian - Insert snappy one-liner here.

              P Offline
              P Offline
              Pete OHanlon
              wrote on last edited by
              #6

              You assume that this person was a contractor. Hmmmm.:laugh:

              Please visit http://www.readytogiveup.com/ and do something special today. Deja View - the feeling that you've seen this post before.

              1 Reply Last reply
              0
              • P Pete OHanlon

                Well - just got this code into review (this is the pseudocode version of a 2000 line routine - a coding WTF in its own right):

                1. Begin Transaction
                2.  Update Table 1 with a single value
                3.  Update Table 1 with another value - to the same row as step 2.
                4.  Pop up message box to ask user to ring somebody to confirm that it is OK to continue.
                5.  Update Table 2
                6. Commit Transaction
                

                The best bit is that the person who coded this, (supposedly an experienced developer), couldn't see that step 4a. User goes out for lunch, means that the transaction could effectively run for an hour or so.

                Please visit http://www.readytogiveup.com/ and do something special today. Deja View - the feeling that you've seen this post before.

                K Offline
                K Offline
                KarstenK
                wrote on last edited by
                #7

                I hope for sake that his managers wanted to write such code.:((

                Greetings from Germany

                1 Reply Last reply
                0
                • P Pete OHanlon

                  Well - just got this code into review (this is the pseudocode version of a 2000 line routine - a coding WTF in its own right):

                  1. Begin Transaction
                  2.  Update Table 1 with a single value
                  3.  Update Table 1 with another value - to the same row as step 2.
                  4.  Pop up message box to ask user to ring somebody to confirm that it is OK to continue.
                  5.  Update Table 2
                  6. Commit Transaction
                  

                  The best bit is that the person who coded this, (supposedly an experienced developer), couldn't see that step 4a. User goes out for lunch, means that the transaction could effectively run for an hour or so.

                  Please visit http://www.readytogiveup.com/ and do something special today. Deja View - the feeling that you've seen this post before.

                  R Offline
                  R Offline
                  Russell Jones
                  wrote on last edited by
                  #8

                  I'm sure I've seen this used as an example in more than 1 place of how NOT to write transaction code. Maybe your guy skip read the chapter and accidentally picked up the wrong flow chart of how to write this stuff. I'm suprised that anyone who has experience with transactions would dream of doing anything other than Begin, Get the job done quick, Get the hell out. Russell

                  1 Reply Last reply
                  0
                  Reply
                  • Reply as topic
                  Log in to reply
                  • Oldest to Newest
                  • Newest to Oldest
                  • Most Votes


                  • Login

                  • Don't have an account? Register

                  • Login or register to search.
                  • First post
                    Last post
                  0
                  • Categories
                  • Recent
                  • Tags
                  • Popular
                  • World
                  • Users
                  • Groups