0 Replies Latest reply on Apr 2, 2008 8:41 AM by joshua_shizny

    sqlite transaction begin event handler only fires once

    joshua_shizny
      Hello, I have this code that starts a sql transaction. I have attached a eventListener to the begin transaction event so I can start running all the queries etc. When the queries are done I remove the event listener because I start a new transaction. Everything works great until I try and reassign the begin event handler twice. I can't get sqlConn.begin to send out the event twice, even if I unregister it in between. I tried using responders and it won't respond the second time either. Here is a brief example of what I'm talking about.

      I'm super stuck

      Code:

      function prepTransaction() {
      _sqlConn.addEventListener(SQLEvent.BEGIN,startQuery);
      _sqlConn.begin();
      }

      function startQuery(e:SQLEvent) {
      _sqlConn.removeEventListener(SQLEvent.BEGIN,startQuery);

      // do a bunch of queries
      _sqlConn.commit();
      }

      Then later.....

      I call prepTransaction and it will not ever get to startQuery, no event is broadcast