Issue with VC++, VB, COM+ and COM. 
Author Message
 Issue with VC++, VB, COM+ and COM.

All,

This is a live case, from an integration project with two companies. Company
A is developing objects in VC++ for use in COM+. Company B is using VB to
develop their COM objects. The structure is as follows:

VC++ objects reside in COM+ server. This code instantiate the VB COM
objects. Both COM+ and COM objects wishes to send database querys that are
part of the same distributed transaction (DTC transaction). Any objections?
Any comments on how to do this? Is it possible?

The status on the live case is as follows: The COM+ object instantiates a
DB-connection an passes it over to the COM-object. The problem occurs when 2
"users" of the system performs the same operation at the same time. The one
operation goes as far as to a DB-query that is sent from the COM object and
blocked in the SQL-server (DB-locks). The other operation (which has set the
locks the first is waiting for) seem just to hang for no good reason. There
is no DB-locks stopping the next query, but the flow of execution just seems
to stop. Could this be due to the threading models in the different objects
(which I do not kow). Our current working theory is that since the flow of
execution has stopped withing the method of one instance of the COM object
(due to DB-lock), the other instance of the COM object doesn't allow a call
to the same method. Does this sound like a reasonable theory??

All comments are welcome.

Best regards,
 -Anders.



Sat, 02 Aug 2003 05:39:41 GMT  
 Issue with VC++, VB, COM+ and COM.

simply use declarative transactions and do NOT pass connection objects

ur vb objects must be apartment threaded


Quote:
> All,

> This is a live case, from an integration project with two companies.
Company
> A is developing objects in VC++ for use in COM+. Company B is using VB to
> develop their COM objects. The structure is as follows:

> VC++ objects reside in COM+ server. This code instantiate the VB COM
> objects. Both COM+ and COM objects wishes to send database querys that are
> part of the same distributed transaction (DTC transaction). Any
objections?
> Any comments on how to do this? Is it possible?

> The status on the live case is as follows: The COM+ object instantiates a
> DB-connection an passes it over to the COM-object. The problem occurs when
2
> "users" of the system performs the same operation at the same time. The
one
> operation goes as far as to a DB-query that is sent from the COM object
and
> blocked in the SQL-server (DB-locks). The other operation (which has set
the
> locks the first is waiting for) seem just to hang for no good reason.
There
> is no DB-locks stopping the next query, but the flow of execution just
seems
> to stop. Could this be due to the threading models in the different
objects
> (which I do not kow). Our current working theory is that since the flow of
> execution has stopped withing the method of one instance of the COM object
> (due to DB-lock), the other instance of the COM object doesn't allow a
call
> to the same method. Does this sound like a reasonable theory??

> All comments are welcome.

> Best regards,
>  -Anders.



Sat, 02 Aug 2003 19:02:21 GMT  
 Issue with VC++, VB, COM+ and COM.
Well, in order to get the COM+ transactions to work (DTC-transactions) we
have to instantiate and open the connection in the COM+ object and pass it
over to the COM objects. Since we are talking about integrating existing
COM+ and COM objects there is little or no room to rewrite the objects.

What we tried today was to recompile the COM+ objects (written in VC++) as
only STA threading model. This seems to deal with our problem.

-Anders.


Quote:

> simply use declarative transactions and do NOT pass connection objects

> ur vb objects must be apartment threaded



> > All,

> > This is a live case, from an integration project with two companies.
> Company
> > A is developing objects in VC++ for use in COM+. Company B is using VB
to
> > develop their COM objects. The structure is as follows:

> > VC++ objects reside in COM+ server. This code instantiate the VB COM
> > objects. Both COM+ and COM objects wishes to send database querys that
are
> > part of the same distributed transaction (DTC transaction). Any
> objections?
> > Any comments on how to do this? Is it possible?

> > The status on the live case is as follows: The COM+ object instantiates
a
> > DB-connection an passes it over to the COM-object. The problem occurs
when
> 2
> > "users" of the system performs the same operation at the same time. The
> one
> > operation goes as far as to a DB-query that is sent from the COM object
> and
> > blocked in the SQL-server (DB-locks). The other operation (which has set
> the
> > locks the first is waiting for) seem just to hang for no good reason.
> There
> > is no DB-locks stopping the next query, but the flow of execution just
> seems
> > to stop. Could this be due to the threading models in the different
> objects
> > (which I do not kow). Our current working theory is that since the flow
of
> > execution has stopped withing the method of one instance of the COM
object
> > (due to DB-lock), the other instance of the COM object doesn't allow a
> call
> > to the same method. Does this sound like a reasonable theory??

> > All comments are welcome.

> > Best regards,
> >  -Anders.



Sun, 03 Aug 2003 02:48:44 GMT  
 Issue with VC++, VB, COM+ and COM.


Quote:
> Well, in order to get the COM+ transactions to work (DTC-transactions) we
> have to instantiate and open the connection in the COM+ object and pass it
> over to the COM objects. Since we are talking about integrating existing
> COM+ and COM objects there is little or no room to rewrite the objects.

u will have many problems with this design...

Quote:

> What we tried today was to recompile the COM+ objects (written in VC++) as
> only STA threading model. This seems to deal with our problem.

what was it before? MTA?


Sun, 03 Aug 2003 06:36:59 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. VC-COM from VB/VC/Script

2. Call VB DLL or COM object from within VB COM object or EXE

3. VB image list handle isn't fully accessible in VC++ ActiveX thru COM call

4. COM, VB, and VC++

5. Using VB Com objects from VC++

6. VC++ to VB Interface (COM / ATL / ?)

7. VC++ COM Callback doesn't work in VB ActiveX

8. VB COM calling VC++ DLL error

9. Help-- Problem with Sharing data betweeb a VC++ COM and a VB app

10. VB/VC COM dll/ who owns the memory?

11. Sending error from VC++ COM object to VB

 

 
Powered by phpBB® Forum Software