Author Topic: If & Commit  (Read 2089 times)

0 Members and 1 Guest are viewing this topic.

nobody

  • Swamp Rat
  • Posts: 861
  • .net stuff
If & Commit
« on: February 05, 2021, 04:22:10 PM »
Does return prevent a function from completing a transaction? Thinking I should be committing a transaction before a return if I use it.

transaction
{
if (something == null)
   {
    transaction.Commit();
    BEFORE return;
   }
transaction.Commit();
}

JohnK

  • Administrator
  • Seagull
  • Posts: 10605
Re: If & Commit
« Reply #1 on: February 05, 2021, 07:50:14 PM »
Return terminates everything but if you have it in a try block I think the finally block still runs.
TheSwamp.org (serving the CAD community since 2003)
Member location map - Add yourself

Donate to TheSwamp.org

nobody

  • Swamp Rat
  • Posts: 861
  • .net stuff
Re: If & Commit
« Reply #2 on: February 06, 2021, 04:40:19 PM »
Thanks No. 7, are you 7 of 9?

JohnK

  • Administrator
  • Seagull
  • Posts: 10605
Re: If & Commit
« Reply #3 on: February 06, 2021, 10:30:06 PM »
Not sure but I guess, if 6 was 9 then I might be 4 of 6.
TheSwamp.org (serving the CAD community since 2003)
Member location map - Add yourself

Donate to TheSwamp.org

nobody

  • Swamp Rat
  • Posts: 861
  • .net stuff
Re: If & Commit
« Reply #4 on: February 08, 2021, 07:31:20 PM »
Well, this used to be 7 of 9. I think you'd know if you were this 7.  At least I hope so.


EDIT (John): Removed attachment before I get a PM (better safe then sorry).
« Last Edit: February 08, 2021, 08:36:32 PM by John Kaul (Se7en) »

JohnK

  • Administrator
  • Seagull
  • Posts: 10605
Re: If & Commit
« Reply #5 on: February 08, 2021, 08:39:38 PM »
Nope. That's not me (sorry :]). I'm not big on fantasy art. About the closest I got was a kandinsky print having on an apartment wall.
TheSwamp.org (serving the CAD community since 2003)
Member location map - Add yourself

Donate to TheSwamp.org

nobody

  • Swamp Rat
  • Posts: 861
  • .net stuff
Re: If & Commit
« Reply #6 on: February 09, 2021, 12:45:33 PM »
Nope. That's not me (sorry :]). I'm not big on fantasy art. About the closest I got was a kandinsky print having on an apartment wall.

That "Fantasy Art" made billions lol... that was Star Trek

JohnK

  • Administrator
  • Seagull
  • Posts: 10605
Re: If & Commit
« Reply #7 on: February 09, 2021, 02:28:50 PM »
Oh I thought you meant a painter...an artist that painted artwork?! *duh!* Sorry.

Oh, that 7 of 9! I thought that lady looked familiar. ...anyways; no, I'm on the other team from that 7 of 9.


*Phew!* sorry! that joke was belabored and beaten to death! my bad. I will try to do better next joke.
TheSwamp.org (serving the CAD community since 2003)
Member location map - Add yourself

Donate to TheSwamp.org