COM+ Transactions

Results 1 to 2 of 2

Thread: COM+ Transactions

  1. #1
    Join Date
    Dec 1969

    Default COM+ Transactions

    I have a component I have written in VB that is using transactions. The component&#039;s MTSTransactionMode is set to 2 - RequiresTransaction.<BR><BR>On the ObjectControl_Activate() Event, I set a variable called gobjContext = GetObjectContext(). On the ObjectControl_Deactivate event, I set the gobjContext = Nothing.<BR><BR>I have an OpenConn function that opens a connection to our database (SQL Server 7) if it hasn&#039;t already been opened. I have a CloseConn function that closes the connection to the database.<BR><BR>I then have 3 public methods on my COM object that all need to contained within a single transaction. So, what I am doing is from ASP:<BR>obj.OpenConn<BR>obj.Method1 (inserts/updates)<BR>obj.Method2 (inserts/updates)<BR>obj.Method3 (inserts/updates -- calls private method privMethod4)<BR>obj.CloseConn<BR><BR>This keeps everything within a single transaction. If any of the methods error out, gobjContext.SetAbort is called.<BR><BR>One of my concerns is that with ASP, a user can stop the execution of a page and even though it isn&#039;t likely, it is possible that obj.CloseConn will not be called. If it isn&#039;t called, I would like to have the transaction rolled back.<BR><BR>This isn&#039;t what is currently happening. Right now, it doesn&#039;t matter if .CloseConn is called or not, the transactions are being committed. It works properly if gobjContext.SetAbort is specifically called.<BR><BR>Any information about this is greatly appreciated. Let me know if you have any questions or need further information.<BR><BR>-Doug

  2. #2
    Join Date
    Dec 1969

    Default RE: COM+ Transactions

    It&#039;s not actually correct that the user can stop *execution* of an ASP page - they can stop their browser downloading and rendering the response, but the page will continue executing on the server anyway. The server doesn&#039;t know that the user has hit the "stop" button.<BR><BR>Dunc

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts