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

Thanks in advance,
PL

Re: Ado.Net and COM+ by Paul

Paul
Thu Jul 08 13:25:01 CDT 2004

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)

Re: Ado.Net and COM+ by Barbelith

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

Re: Ado.Net and COM+ by Paul

Paul
Fri Jul 09 12:45:09 CDT 2004

On Thu, 08 Jul 2004 21:35:43 +0200, Barbelith <Barbelith@Gallileo.mo> wrote:


¤ >
¤ >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.

If you want to see whether the rollback affects the data in the datatable then I would suggest you
run a simple proof of concept.

I would also suggest the following KB article:

How To Roll Back Updates After an Error When You Use DataAdapter and DataSet in ADO.NET and Visual
Basic .NET
http://support.microsoft.com/default.aspx?scid=kb;en-us;310351


Paul ~~~ pclement@ameritech.net
Microsoft MVP (Visual Basic)

Re: Ado.Net and COM+ by Angel

Angel
Mon Jul 12 21:18:02 CDT 2004

Barbelith,

In the currently released versions of the framework you can use COM+
transactions by deriving from enterprise services, making your object
visible to COM and using properties to control your transaction. You can
find more information here:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dndotnet/html/disttranvbnet.asp

We realize that this is overly complicated, In the upcoming Whidbey release
we are deploying an entirely managed solution for this problem. Take a look
at my blog for extensive information on ado.net and System.Transactions
transactions.

--
Angel Saenz-Badillos [MS] Managed Providers
This posting is provided "AS IS", with no warranties, and confers no
rights.Please do not send email directly to this alias.
This alias is for newsgroup purposes only.
I am now blogging about ADO.NET: http://weblogs.asp.net/angelsb/




"Barbelith" <Barbelith@Gallileo.mo> wrote in message
news:mn0pe0dn18720f8u3uapu43aqlvveil051@4ax.com...
>
>
> 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
>
> Thanks in advance,
> PL