Barbelith
Thu Jul 08 14:33:34 CDT 2004
On Thu, 08 Jul 2004 13:25:01 -0500, Paul Clement
<UseAdddressAtEndofMessage@swspectrum.com> wrote:
>On Thu, 08 Jul 2004 01:22:17 +0200, Barbelith <Barbelith@Gallileo.mo> wrote:
>
>¤
>¤
>¤ Hello
>¤
>¤ I'm pretty new to ADO.Net and I'm still a little confused about some
>¤ things, I hope I can make myself clear.
>¤
>¤ I'm writing a data-centric web application using ASP.Net, based on a
>¤ SQL Server 2000 database.
>¤
>¤ I have a table called Person that I'll take as an example of how I
>¤ access data.
>¤
>¤ I build a dataadapter that access a stored procedure and returns the
>¤ data into a dataset.
>¤
>¤ i take the datatable and pass it to a custom business object that i
>¤ use as a PersonCollection.
>¤
>¤ If I want a certain person i query the table and return a datarow that
>¤ I wrap inside a custon Person object, with properties that wrap the
>¤ datarow fields.
>¤
>¤ What i want wo know is: how do I update 2 or three of my wrapped
>¤ tables inside the same transaction using COM+?
>¤ I'm a litte confused about this.
>¤ I can update the fields inside the datarows and the write back the
>¤ changes using a dataadapter using its Updatestatement.
>¤ But as far as I know a COM+ transaction abort will not affect the
>¤ datarows rowstate attributes.
>¤
>¤ I'm not sure I make mayself clear here, I guess I'm just looking for
>¤ beste practices to update several datatables inside the same
>¤ transaction using COM+, maybe someone knows what I'm talkong about and
>¤ can help
>
>I would recommend reading the documentation so that you understand how serviced components operate.
>Keep in mind that COM+ maintains the context and as long as the context is implemented properly you
>should be able to rollback (SetAbort) multiple dependent updates.
>
>
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguide/html/cpconservicedcomponentoverview.asp
>
>
>Paul ~~~ pclement@ameritech.net
>Microsoft MVP (Visual Basic)
Thing is, i know how COM+ transactions work.
I know that an aborted transaction will roll back all changes to the
database(s) inside the same transaction.
What I DON'T know is how this will effect the rowstate inside the
datatable/set.
Say I want to update two datatables inside a transaction using the
dataset's update method.
Table 1 successfully updates and, I would think, calls AcceptChanges()
on all affected rows.
Table 2 throws an error and causes a database rollback.
What will happen to the datarows inside table 1?
Will their values also be rolled back or do I have to undo all changes
by hand?
I'm really, REALLY trying to figure this out myself but I can't find
anything about this stuff, so any help here is really appreciated.
PL