The EntitySpaces Community

Share and learn about the EntitySpaces Architecture.
Welcome to The EntitySpaces Community Sign in | Join | Help
in
Home Forums Photos

Rollback?

Last post 05-30-2007, 11:01 PM by kwilder. 6 replies.
Sort Posts: Previous Next
  •  05-30-2007, 11:59 AM 2895

    Rollback?

    I'm coming from dOOdads and was wondering if there's a rollback method on the esTransactions object?  Or does it rollback if scope.Complete() is not called?

    Thanks. 


    King Wilder
    http://www.kingwilder.com
  •  05-30-2007, 12:20 PM 2896 in reply to 2895

    Re: Rollback?

    Hi

    The transaction will roll-back if scope.Complete() isn't called. I think there was a blog post about the transaction usage etc - can't remember when it was though but it wasn't too long ago

    Cheers

    Martin

  •  05-30-2007, 1:09 PM 2897 in reply to 2896

    Re: Rollback?

    Yes, I've read the Blog post, it just never mentioned what happens if there's an error.  This is what I was hoping is the case, thanks.

    King Wilder
    http://www.kingwilder.com
  •  05-30-2007, 3:24 PM 2900 in reply to 2897

    Re: Rollback?

    If you exit an esTransactionScope using statement

     

    Code:
    using(esTransactionScope scope = new esTransactionScope())
    {
    obj1.Save();
    obj2.Save();

    // Exception is thrown or you just do a "return" rolls back the trans

    // This should AWLAYS be the very last line of code in
    // the using statement

    scope.Complete();
    }

    The transaction will be rolled back if for any reason scope.complete() is not called. The esTransactionScope class doesn't throw an exception. It is rolling back typically because one has been thrown.
    EntitySpaces | Twitter | BLOG | Please honor our Software License
  •  05-30-2007, 5:29 PM 2916 in reply to 2900

    Re: Rollback?

    Thank you, it worked!  Good thing, because I'm updating around 12 tables at one time.  Sheesh!  I did have a couple errors initially and the transactions were rolled back because nothing appeared in the database.

    Then when no errors, all tables were successfully updated.  This is cool! 


    King Wilder
    http://www.kingwilder.com
  •  05-30-2007, 5:47 PM 2917 in reply to 2916

    Re: Rollback?

    I think our transaction support is one of the key features of EntitySpaces, they're seemless yet so powerful. If you want to do serious enterprise level applications you've got to have serious transaction support. Glad it's all clicking for you. Thank you for the positive feedback.

    EntitySpaces | Twitter | BLOG | Please honor our Software License
  •  05-30-2007, 11:01 PM 2920 in reply to 2917

    Re: Rollback?

    Its the Transaction support, as well as being able to instantly retrieve the Identity of a newly added record, and "scaffolds" on steroids that made me switch from SubSonic a Free tool, to ES.  This just seems complete.

    And don't get me wrong, I may post a bunch of "How do I..." in the Forums, but there's always a learning curve for any new tool.  And so far I love it.

    Thanks.


    King Wilder
    http://www.kingwilder.com
View as RSS news feed in XML