Skip to content
This repository has been archived by the owner on Dec 30, 2024. It is now read-only.

rollback when no transaction is active #61

Open
mahmoudbahaa opened this issue Sep 19, 2011 · 0 comments
Open

rollback when no transaction is active #61

mahmoudbahaa opened this issue Sep 19, 2011 · 0 comments

Comments

@mahmoudbahaa
Copy link

In AIRServiceProvider commitTransaction method , in case of SQLErrorEvent connection.rollback(); is called

connection.addEventListener(SQLErrorEvent.ERROR, function(event:SQLErrorEvent):void {
        event.currentTarget.removeEventListener(event.type, arguments.callee);
        Rx.log.debug("rolling back");
        connection.rollback();
        if (responder) responder.fault(event.error);
});

but sometimes it gives an error saying ( no active transaction) so we need to check for it

connection.addEventListener(SQLErrorEvent.ERROR, function(event:SQLErrorEvent):void {
        event.currentTarget.removeEventListener(event.type, arguments.callee);
      if(connection.inTransaction)  {
               Rx.log.debug("rolling back");
               connection.rollback();
       }
        if (responder) responder.fault(event.error);
 });

i created a simple patch here http://www.mediafire.com/?2ihd08j0syqeyv0

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant