Re: Q: detect uncommited changes

From: joel garry <joel-garry_at_home.com>
Date: Thu, 31 Jul 2008 15:32:50 -0700 (PDT)
Message-ID: <c8ab4246-236c-4864-93d3-f1e3475527b5@u12g2000prd.googlegroups.com>


On Jul 31, 1:47 pm, yf..._at_vtn1.victoria.tc.ca (Malcolm Dew-Jones) wrote:
> "Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production"
> and forms (fmb) that come with the that version of developer.
>
> Say I have a form A that calls another form B and that the called form B
> may post data without committing it, and then exit without rolling back.  
> The caller (A) will see the changes (i.e. if it selects the data it gets
> the updated values) and can then decide to commit them or rollback as it
> chooses.  That is all pretty standard stuff.
>
> In the case that the called form (B) has committed its changes then the
> caller (A) can detect that with 100% reliability by examining
> dbms_transaction. local_transaction_id.  If the id is null then there are
> no outstanding changes that may need to be committed.  (And hence no need
> to prompt the user to save any changes).
>
> The exact reverse also works reliably.  If the called form (B) POSTs data
> without a commit then local_transaction_id is always non-null.  The caller
> form (A) will always detect that a change was made, and that the user
> needs to be prompted to commit those changes before it exits.
>
> The problem I am examing is that the local_transaction_id will sometimes
> be non-null even though the called form (B) did not post any changes at
> all. In that case the caller form (A) will prompt the user to save the
> changes, but there were no changes made.  It is "safe" in the sense that
> the user will never lose any data by committing the session, but confusing
> as they may have made no changes in either form.
>
> I am looking for the best way for the caller form (A) to detect that the
> called form (B) really did post data to the database.
>
> Suggestions welcome.

Well, I have no idea about this stuff, but just looking at the docs I think your assumptions may be off.

A transaction starts when the first executable SQL is encountered. So I would hope that local_transaction_id would be populated at that time. Apologies if I don't understand what that sp is about, and double apologies for not knowing about forms since 2.3 that I can't even remember, but see http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:509146277753

jg

--
@home.com is bogus.
Death of usenet, news at 11.  http://tech.slashdot.org/article.pl?no_d2=1&sid=08/07/31/1622251
Received on Thu Jul 31 2008 - 17:32:50 CDT

Original text of this message