What is the right SQL cleanup/transaction framework for my application?

    (1) find a way to use in-built mysql innodb transaction support.

        pros:
        - the most pure answer.

        cons:
        - not sure how to write the code, do I need to pass around a DB
          object to every other object?
        - potentially a lot of recoding.

        so how will transactions fit in?

            MeetingInvite.__init__()
                self.db_connection = eamm.backend.database.MyDatabase()

                self.add()

                    * __already_exists() and __add_to_invite_tbl() should both
                      be fine, because we can just do a quick check to say:
                      if (self.db_connection is working):
                        use it,
                      else:
                        re_initialize self.db_connection.

                    * database.insert() and database.insert2() need to either:
                      have a way of turning off autocommit or never be
                      enabled for it in the first place.

                    * any method that uses and stmt to make a change to the
                      db needs to decided whether it is autocomitting (if that
                      is an option we give to users).

                    * Meeting.add() needs to use the same db_connection
                        * when do we pass the Meeting class the db_connection
                          object?
                            - on init?  Meeting.__init__(self, db_connection)
                            - on change? Meeting.add() Meeting.delete(),
                              Meeting.update()?

                          * actually, what is the best way to pass arguments to a
                            function?
                            - use def my_function(**kwargs), this allows me to do
                              stuff like my_function(my_form=the_form, my_db=db_con)

                          so the answer is to pass the db_connection object at
                          __init__() time, using some **kwargs.

    (2) hack my own transaction-esque support, by inserting everything as "WIP"
        or something like that.
            - add a STATUS and a LAST_MODIFED colum to every table.
            - every workflow adds new table entries with STATUS = 'WIP'
              and LAST_MODIFIED = 'now()'
            - at the end of a workflow, a set_active() method can be
              called that will set status = "COMPLETE" or whatever.

        pros:
        - might not mean passing around DB objects?

        cons:
        - its a hack.
          -> Hacks are never really worth it in the long run, are they?
        - it's also a lot of coding.
        - i don't think this will provide transaction support for updates.
          -> if it doesn't then the hack definitely isn't worth it.

        ok, the cons are too much here, this option is out.

=====

meeting_invite_webpage.add_meeting_invite_step_5():

    # create a new DB connection instance, with autocommit off.
    db_transaction_con = eamm.backend.database(autocommit=off)

    # create a new MeetingInvite instance, same as before.
    new_invite = eamm.backend.meeting_invite.MeetingInvite(form)

    # reach in and set a new DB attribute.
    new_invite.db_connection = db_transaction_con

    new_invite.add()

        MeetingInvite.add():
            MeetingInvite.__already_exists():
                # let this use the a diff DB connection.
                # no need for it to be on the same connection, so
                # lets not change more code than necessary.
            MeetingInvite.__add_to_invite_tbl():
                if self.db_connection:
                    # use this.
                else:
                    # use existing code path.

    my_meeting = eamm.backend.meeting.Meeting()
    my_meeting.db_connection = db_transaction_con
    my_meeting.add(self.id_invite, self.start_datetime, self.end_datetime, self.requester)