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 -> VB -> Oracle through ORADC, transactions

VB -> Oracle through ORADC, transactions

From: Jens <jf_at_lpt.dk>
Date: Mon, 17 Aug 1998 14:35:18 +0200
Message-ID: <6r982a$ab1$1@dalen.get2net.dk>


Help me please....
I'm trying to get a grip of transactions ....

I have a VB application connecting to Oracle through an Oracle OCX called ORADC.OCX. This works great, but is there any way to begin a transaction inside a transaction. (Nested transactions??) Consider following case:

I have two tables MASTER and DETAIL

I want the following scenario to work
Begin Transaction(1)

    Add record(A) to MASTER
    Begin Transaction(2)

        Add record(1) to DETAIL
        Add record(2) to DETAIL

    Commit Transaction(2) 'NOT commited in database yet.     Begin Transaction(3)

        Add record(3) to DETAIL
    Rollback Transaction(3)
Commit Transaction(1) 'Commits MASTER, then commits records 1 and 2 in detail

In Delphi I would do something like this... Begin Transaction(1)

    Add record(A) to MASTER
    DETAIL.CACHEDUPDATES := TRUE

        Add record(1) to DETAIL
        Add record(2) to DETAIL

    DETAIL.COMMITUPDATES
    DETAIL.APPLYUPDATES {NOT commited in database yet.}

            Add record(3) to DETAIL
    DETAIL.CANCELUPDATES
Commit Transaction(1) 'Commits MASTER, then commits records 1 and 2 in detail

If anyone knows of a way to do this I'd be happy to know... Does ORADC have a cache I can work with, or how is this done. Answers will be rewarded with a virtual rose.

Jens Received on Mon Aug 17 1998 - 07:35:18 CDT

Original text of this message

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