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

Home -> Community -> Usenet -> c.d.o.server -> Re: how to code a transaction.

Re: how to code a transaction.

From: Valentin Minzatu <valentinminzatu_at_yahoo.com>
Date: 6 Mar 2007 11:37:19 -0800
Message-ID: <1173209839.577987.53960@8g2000cwh.googlegroups.com>


On Mar 6, 12:19 pm, xhos..._at_gmail.com wrote:
> i676..._at_gmail.com wrote:
> > i,
>
> > How do I manually code an atomic transaction, given the following
> > scenario?
>
> > 1. User need to pay a fine.
> > 2. User log into the system.
> > 3. User click the pay button.
> > 4. User pay by a custom payment methods called NETS (system operated
> > through telephone line, in Singapore; it is not direct connection to a
> > databse, but somekind of services.)
> > 5. Payment/NETS transaction done; transaction cannot rollback after
> > this.
> > 6. System would update the database to indicate the fine have been
> > paid.
>
> > But step 6 might fail. How do I ensure that all the steps is in
> > one single transaction?
>
> Unless NETS has distributed transaction features you haven't described, you
> can't. You have to db-commit after step 3, with some kind of "transaction
> In doubt" flag. After step 5, you change it to either "transaction done"
> and db-commit that, or you change it to "transaction failed" (or do what is
> needed to achieve the same thing as rolling back rather than comitting at
> step 3 would have done) and db-commit that, depending the the manner in
> which step 5 completes.
>
> You need to manually intervene on transactions that remain in doubt because
> steps 4 or 5 crashed without reporting either a success or a failure.
> (i.e. transaction is on doubt and time stamp is unreasonably long ago.)
>
> > Is there any example/web page which show how to program a atomic
> > transaction manually?
>
> That would depend on what kinds of distributed transactions NETS will
> support, if any.
>
> Xho
>
> --
> --------------------http://NewsReader.Com/--------------------
> Usenet Newsgroup Service $9.95/Month 30GB- Hide quoted text -
>
> - Show quoted text -

It all comes back to properly defining the logical transaction. The same boundaries apply to the physical one.

Valentin Received on Tue Mar 06 2007 - 13:37:19 CST

Original text of this message

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