VB6/COM+ multiple database transaction errors not trapped soon enough 
Author Message
 VB6/COM+ multiple database transaction errors not trapped soon enough

Hello,

I am using VB6 SP5 over Windows 2K SP2 to develop a class library that runs
as a library component of IIS.  My DLL updates three SQL Server 2K databases
via ADO.  I initialize the connection object provider to "sqloledb".

Sometimes, a single embedded SQL transaction (insert or update) will change
multiple SQL Server databases via SQL Server triggers.  In such cases, I
understand that I need to set the appropriate VB class MTSTransactionMode
property to RequiresNewTransaction in the root COM+ object and
RequiresTranscation in subordinate objects so that the multiple-database
update will be managed.  But, it doesn't trap the errors until the root
object executes mobjContext.SetComplete and the "On Error..." condition that
would report the failure in a user friendly manner passes out of scope.

Does anyone know how to get VB6/COM+ to trap multiple-database transaction
errors as when the embedded SQL command is executed?



Tue, 15 Jun 2004 09:53:16 GMT  
 VB6/COM+ multiple database transaction errors not trapped soon enough


Fri, 19 Jun 1992 00:00:00 GMT  
 VB6/COM+ multiple database transaction errors not trapped soon enough
Hello again,

I now realize that distributed COM+ transactions are commited at Setcomplete
time by design and that its my job, as an application developer, to call
Setcomplete when it can be trapped by my application.  My application uses
Active Server Pages to call root COM+ objects (VB6 classes) which, in turn
call secondary COM+ objects (also VB6 classes).  Since the secondary object
executes the embedded SQL command, there is no need to include the caller in
the transaction.  The caller can then trap the error gracefully when the
secondary object Setcomplete fails.

Specifically, I resolved the problem described below by setting the
MTSTransactionMode property of my called COM+ object to
"RequiresTransaction" and execute mobjContext.SetComplete therein while
setting the root COM+ object's property to "NoTransaction".  The only fly in
the oinment is that the error message returned by the system is a timeout
error rather than an error reported by the trigger as when the same
transaction is executed using the SQL Server query analyzer.  I suppose
there is a way to peel through the Conn.errors stack and find it.


Quote:
> Hello,

> I am using VB6 SP5 over Windows 2K SP2 to develop a class library that
runs
> as a library component of IIS.  My DLL updates three SQL Server 2K
databases
> via ADO.  I initialize the connection object provider to "sqloledb".

> Sometimes, a single embedded SQL transaction (insert or update) will
change
> multiple SQL Server databases via SQL Server triggers.  In such cases, I
> understand that I need to set the appropriate VB class MTSTransactionMode
> property to RequiresNewTransaction in the root COM+ object and
> RequiresTranscation in subordinate objects so that the multiple-database
> update will be managed.  But, it doesn't trap the errors until the root
> object executes mobjContext.SetComplete and the "On Error..." condition
that
> would report the failure in a user friendly manner passes out of scope.

> Does anyone know how to get VB6/COM+ to trap multiple-database transaction
> errors as when the embedded SQL command is executed?



Tue, 15 Jun 2004 23:06:46 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Variable does not pass soon enough

2. Why to use COM+ transaction and not just SQL Server transaction

3. Why to use COM+ transaction and not just SQL Server transaction

4. COM+ Automation Error/connection to the transaction manager failed Error/ Q331953

5. Transactions and error trapping

6. Error trapping and re-trying the transaction ....

7. VB6-DataEnvironment: Executing Multiple Delete Commands (Transaction ????)

8. Debugging COM+ Transaction component under VB6, SP3

9. error 7 in access 7.0 not enough memory

10. Not enough memory (Error 2004)

11. Error 3026 Not enough space, but 2G space

12. "Not enough memory" error during compile

 

 
Powered by phpBB® Forum Software