🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: borland.public.cppbuilder.database.ado
2 messages
2 total messages Started by Cem Uzunlar Thu, 08 Mar 2001 13:30
ADO and Transactions
#5680
Author: Cem Uzunlar
Date: Thu, 08 Mar 2001 13:30
29 lines
1697 bytes
C1 and C2 are ADOConnection objects
Q2 and Q2 are ADOQuery objects

Following code raises and exception when second record tries to do
updatebatch. If we dont use transactions, the problem goes away.

How can we solve this problem?

Thanks.

    C1->Open();
    C2->Open();

    C1->BeginTrans();
    C2->BeginTrans();

    Q1->Open();
    Q2->Open();

    Q1->Append();
    Q1->FieldByName("A1")->AsFloat = 5000;
    Q1->UpdateBatch( arCurrent );

    Q2->Append();
    Q2->FieldByName("A1")->AsFloat = 6000;
    Q2->UpdateBatch( arCurrent );

    C1->CommitTrans();
    C2->CommitTrans();
Re: ADO and Transactions
#5626
Author: Mehdin Hod�i�
Date: Fri, 23 Mar 2001 10:00
37 lines
1766 bytes
I'm not sure if you can do that, but if you can check for the transaction
type.I thing it should not be Isolated or something like this, try with
ReadUncommited or any other type

Cem Uzunlar <turing@anet.net.tr> wrote in message news:3aa789a6_2@dnews...
> C1 and C2 are ADOConnection objects
> Q2 and Q2 are ADOQuery objects
>
> Following code raises and exception when second record tries to do
> updatebatch. If we dont use transactions, the problem goes away.
>
> How can we solve this problem?
>
> Thanks.
>
>     C1->Open();
>     C2->Open();
>
>     C1->BeginTrans();
>     C2->BeginTrans();
>
>     Q1->Open();
>     Q2->Open();
>
>     Q1->Append();
>     Q1->FieldByName("A1")->AsFloat = 5000;
>     Q1->UpdateBatch( arCurrent );
>
>     Q2->Append();
>     Q2->FieldByName("A1")->AsFloat = 6000;
>     Q2->UpdateBatch( arCurrent );
>
>     C1->CommitTrans();
>     C2->CommitTrans();
>
>
>
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads