Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: Trivia Question: Any point to CommitTrans with no Rollback?

Re: Trivia Question: Any point to CommitTrans with no Rollback?

From: Ed Prochak <edprochak_at_adelphia.net>
Date: Mon, 05 May 2003 13:02:04 GMT
Message-ID: <3EB664E5.7060303@adelphia.net>


Larry Leonard wrote:
> I'm not an Oracle newbie, but I'm far from a guru.
>
> I've inherited a lot of OO4O code that uses what to me looks like an
> odd idiom. In many places - most of the time, in fact - a BeginTrans
> is called, some work is done, and then a CommitTrans is done. There's
> no error checking, and there's no call to Rollback anywhere.
>
> Am I correct in thinking that a transaction without the possibility of
> a Rollback is pointless? Or is there some advantage (performance?) to
> wrapping several actions in a transaction, even if you can never
> rollback? OO4O methods don't throw exceptions (well, some of them do,
> but not the ones I use), so I don't think that's it.
>
> Ideas? TIA.

Seeing no other replies,

You wrap things in a transaction to make sure they all happen or they all do not happen. It is precisely the fact that you do not want partial data to enter the database.

Since you are talking about OO4O, your program most likely resides on a client PC. What would you want to happen if partway thru a group of inserts the PC lost power (you never kicked a power cord?). Just because the client doesn't catch the exception doesn't mean it doesn't happen.

So you still want a commit at the appropriate points.

HTH

-- 
Ed Prochak
running    http://www.faqs.org/faqs/running-faq/
netiquette http://www.psg.com/emily.html
--
"Two roads diverged in a wood and I
I took the one less travelled by
and that has made all the difference."
robert frost
Received on Mon May 05 2003 - 08:02:04 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US