Home All Groups Group Topic Archive Search About
Author
9 Mar 2006 2:59 AM
John
i need advice to my problems as follow:

i need to update 3 table (say table a, table b and table c) using
sqltransaction (because i want all transaction either commit or > rollback).
table c will be updated after table a and table b updated.
the problem is:
table c can not updated because of sqltransaction didn't update (commit) the
table a and b yet .
any idea how to solve this problem?

Author
9 Mar 2006 8:36 AM
Truong Hong Thi
>the problem is:
>table c can not updated because of sqltransaction didn't update (commit) the
>table a and b yet .
I don't think this problem can happen. Because they are in the same
transaction, changes should be visible. Uncommitted changes made inside
a transaction are only invisible to other transactions (unless they
have IsolationLevel set to ReadUncommitted).

Thi
Author
9 Mar 2006 1:01 PM
Ant
Hi John,

If the three tables are in the same transaction, then each one will be
updated sequentially. If you commit the transaction, all three updates will
be saved; if you rollback the transaction, all three updates will be
discarded. Changes will be made just as if they weren't performed in a
transaction. It's only when you Commit or rollback that the transaction has
any effect. In short, what you're doing should work.
I hope that helps
Ant

Show quote
"John" wrote:

>  i need advice to my problems as follow:
>
> i need to update 3 table (say table a, table b and table c) using
> sqltransaction (because i want all transaction either commit or > rollback).
> table c will be updated after table a and table b updated.
> the problem is:
> table c can not updated because of sqltransaction didn't update (commit) the
> table a and b yet .
> any idea how to solve this problem?
>
>
>
>
Author
9 Mar 2006 3:28 PM
Thomas H
Like everyone said; what you're doing should work... are you using the same
connection object when you update all three tables?  Are there any triggers
on those tables that could be interfering with your update on table C (such
as a primary key change/commit)?

Show quote
"John" <J***@yahoo.com> wrote in message
news:%234YpJWyQGHA.4956@TK2MSFTNGP09.phx.gbl...
> i need advice to my problems as follow:
>
> i need to update 3 table (say table a, table b and table c) using
> sqltransaction (because i want all transaction either commit or >
> rollback). table c will be updated after table a and table b updated.
> the problem is:
> table c can not updated because of sqltransaction didn't update (commit)
> the table a and b yet .
> any idea how to solve this problem?
>
>
>
Author
12 Mar 2006 2:22 AM
John
maybe i didn't make clear explanation and i'm sorry for that.
i'm going to explain again the issue:

table c can create new record if table c see there is new record in table a
and table b.
i use the same connection and sqltransaction to update all tables (a,b and
c)
first the algorithm add new record in table a, and add new record in table
b, and finally create a new record in table c (once again if tabel a and b
updated, those table related by parent (tabel c) and child (tabel a,b)
relation)
when debugger execute tabel c, it come up with error.
the error cause because no childs (tabel a,b) exists.

thanks, hope make you better understand with my problem

Show quote
"Thomas H" <T@H> wrote in message
news:OK4LW44QGHA.1096@TK2MSFTNGP11.phx.gbl...
> Like everyone said; what you're doing should work... are you using the
> same connection object when you update all three tables?  Are there any
> triggers on those tables that could be interfering with your update on
> table C (such as a primary key change/commit)?
>
> "John" <J***@yahoo.com> wrote in message
> news:%234YpJWyQGHA.4956@TK2MSFTNGP09.phx.gbl...
>> i need advice to my problems as follow:
>>
>> i need to update 3 table (say table a, table b and table c) using
>> sqltransaction (because i want all transaction either commit or >
>> rollback). table c will be updated after table a and table b updated.
>> the problem is:
>> table c can not updated because of sqltransaction didn't update (commit)
>> the table a and b yet .
>> any idea how to solve this problem?
>>
>>
>>
>
>

AddThis Social Bookmark Button