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: Checking for uncommited transactions

Re: Checking for uncommited transactions

From: FC <flavio_at_tin.it>
Date: Fri, 07 Mar 2003 10:57:59 GMT
Message-ID: <XW_9a.24785$zo2.712760@news2.tin.it>

"Billy Verreynne" <vslabs_at_onwe.co.za> wrote in message news:b49s34$s69$1_at_ctb-nnrp2.saix.net...
> FC wrote:
>
> > Moreover I never mentioned Oracle Forms, I never used it in my life, I
am
> > talking of a more general concept of form like a form created in VB.
>
> Data bound controls, huh? That's Bad Thing (tm).
>
> The client initiates the transaction in Oracle. The user then selects to
> change the fields on the form.
>
> He selects the "save" button. The data controls sends a commit through.
Not
> a problem.
>
> He selects the "cancel" button. The data controls sends a rollback
through.
> Not a problem.
>
> He exits the form without selecting either. A problem.

Hang on a minute, one can design a screen that contains two forms in two different tabs.
This screen is a "logical" unit, so, switching from one tab to the other doesn't mean you have to commit or rollback. You can defer the commit or rollback until you exit from the "main" screen.

> What does the data control's destructor do when it's called and there's a
pending transaction?
>
> What you can do (maybe not in VB as it sucks as OO language) is to
subclass
> the data control if it does not have a property stating whether or not
> there's a pending transaction - and create such a property.
>
> On the form's destructor method, you enumurate all data control objects
and
> check that property.. and then decide whether to commit or rollback.
>
> Or.. much simple and safer.. you simply rollback all data controls in the
> form's destructor. After all, the user did cancel the form without
electing
> to save the changes he made to the database.

Well, in the reality my original question was regarding this point. Can I write a generic function returning a flag indicating whether there are uncommitted data so that I can ask the user if he wants to commit or rollback prior to quit?

> The problem you dealing with has IMO very little do with Oracle itself,
and
> everything to do with how well behaved the client is wrt how it selects to
> start and end database transactions.
>
> As that is done by the client, you should be able to write code _in_ the
> client to keep track of what transactions are pending. You don't need
> Oracle system tables for that. IMO.
> --
> Billy

All right, thanks for sharing your thoughts, I was just carrying out some experiments with the db in my spare time.

Bye,
Flavio Received on Fri Mar 07 2003 - 04:57:59 CST

Original text of this message

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