Re: AutoComplete attribute in Serviced Components-- how to use?

From: Tomas Restrepo \(MVP\) (tomasr_at_mvps.org)
Date: 08/14/04


Date: Sat, 14 Aug 2004 08:35:38 -0500

Jim,

> The problem for me comes when a transaction is supposed to fail. I've
> modified my child class so that it tries opening an incorrectly-spelled
> table, which triggers an exception. The Catch statement in the child
> component is entered, but the transaction appears to complete, at least
> according to the transaction statistics page in the COM+ explorer? As I
> understand it, the AutoComplete attribute is supposed to abort the
> transaction when an exception occurs, but it doesn't appear to be the case
> here.

Actually, it is supposed to abort the transaction when the method actually
"throws" an exception (that is, when the exception is not handled internally
by the method and bubbles up outside of it's scope), not merely when the
exception occurs. If the child class handles the exception internally, COM+
will never see it, and thus it will never doom the transaction.

Furthermore, an exception would actually have to bubble up all the way out
of the outer component, since otherwise, you'll get the infamous
"transaction wanted to commit but transaction rolled back" error...

-- 
Tomas Restrepo
tomasr@mvps.org


Relevant Pages

  • BEGIN TRANSACTION problem
    ... there was no BEGIN TRANSACTION. ... The test prior to the exception is the first to execute the parent ... The is the exception the unit test is expecting. ... Rollback statement faile with "The ROLLBACK TRANSACTION request has no ...
    (microsoft.public.dotnet.framework.adonet)
  • RE: HELP on New request is not allowed to start because [1264822]
    ... allowed to start because it should come with valid transaction descriptor. ... System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean ... TRXOrders.CLogin.GetTradexUserIDFromQube(String QubeUserID, String GroupCode) ... This error always occurs when we issue the command to SQL Server. ...
    (microsoft.public.dotnet.framework.adonet)
  • Re: CMutex /CEvent (multiple threads)
    ... deals with exception detection. ...  If your function does not handle an exception in Java, ... designer did not understand what a Mutex was and that the notion that Lock could return ... ...roll back transaction ...
    (microsoft.public.vc.mfc)
  • RE: HELP on New request is not allowed to start because [1264822]
    ... "Jeff Glenn" wrote: ... We have posted a simple code reproducing the behavior to Microsoft. ... application doen't raise any exception during a distributed transaction. ...
    (microsoft.public.dotnet.framework.adonet)
  • Re: Behavior of Connection.commit()
    ... You have to remember that Sql Server does not understand the concept of a ... we have to fake this with "Begin transaction" ... exception you probably have data corruption. ... getting this error with our driver and filed it as a bug. ...
    (microsoft.public.sqlserver.jdbcdriver)

Loading