Newbie Questions: setabort, setcomplete, autocomplete
I'm a newbie and am trying to make sure I understand a few things about MTS
/ COM+ correctly. If anyone could answer the following questions I'd appreciate
I understand that to take advantage of MTS or COM+'s JIT (just in time) activation
and deactivation features, you can call the setabort and setcomplete methods
of the objectcontext to deactivate the object. I've also read it's used
to control transactions ... this is the part I'm unsure about. Say, for
instance, I have three objects in the same MTS transaction, all with a transaction
mode of Required. The first object successfully performs a SQL update, then
calls a method on the second object which also successfully performs a SQL
update then calls a method on a third object which is supposed to perform
yet another SQL update. If the third object encounters an error and I call
setabort, does this mean the two previous SQL updates are rolled back?
What would actually happen if i didn't call SetComplete or SetAbort on an
object that's in a MTS package or COM+ application and a method on that object
encounters an error? Can this cause the entire application to hang? I've
seen cases where my COM+ application isn't working, I go into Component services
and I see one of my components "spinning", even
though there is no client accessing it. Stopping and restarting the application
always fixes this problem.
In COM+, if my method has the Autocomplete attribute set to true, how does
it know when to commit or rollback transactions? Going back to the hypothetical
example in question 1, would it automatically rollback the transaction if
the third method encountered an error, and automatically commit the transaction
if no errors occurred? Right now that's what I'm assuming.
Generally speaking, is it better to manually call SetAbort and
SetComplete myself, or use the AutoComplete feature? Why?
thanks in advance to anyone who can help me out
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL