Click here to Skip to main content
15,890,336 members
Home / Discussions / COM
   

COM

 
GeneralRe: How to USE C++ code in VB ?? Pin
Anonymous26-Jan-04 3:04
Anonymous26-Jan-04 3:04 
Generalcom Pin
Member 83849523-Jan-04 19:35
Member 83849523-Jan-04 19:35 
GeneralRe: com Pin
Anonymous24-Jan-04 2:35
Anonymous24-Jan-04 2:35 
GeneralRe: com Pin
Jörgen Sigvardsson25-Jan-04 13:38
Jörgen Sigvardsson25-Jan-04 13:38 
GeneralMake C++ Window available to an OCX Pin
Member 463423-Jan-04 11:28
Member 463423-Jan-04 11:28 
QuestionHow to delete the root storage Pin
Omar Alvi23-Jan-04 3:24
Omar Alvi23-Jan-04 3:24 
AnswerRe: How to delete the root storage Pin
Jörgen Sigvardsson25-Jan-04 13:40
Jörgen Sigvardsson25-Jan-04 13:40 
GeneralProblem with COM+ transactions in large app (long post) Pin
Juan Miguel Venturello21-Jan-04 0:52
Juan Miguel Venturello21-Jan-04 0:52 
Hello everyone. Before being handed this project I have never worked with COM besides as an ActiveX user in VB, but thankfully I had a good MFC/C++, SQL Server background. Now I am responsible for the maintenance of a very large 3 tier application. After complaining to my boss I was not the right guy for the job (and he not caring very much), read a couple of books, did the tutorials, and done already quite a bit of debugging and fixes to the application. Backend is SQL Server 2000 (140 tables exposed through 400+ stored procedures, app never does SQL queries), middle tier is 28 components in a COM+ application and a MFC GUI, also some ATL services and device drivers involved, all which talk to the middle tier.

The software shop that originally did this product closed down and left us the latest version with many issues. I have solved most of them. We where having performance problems (very slow GUI, some deadlocks) so I ran some traces and found out that stored procedures where taking forever to execute - there where way too many indexes – about on everything. Doing things right (in my opinion) I was able to take the execution of the 100 longest running queries down from over a minute to 11 seconds. Watching the execution plan of the most commonly executed stored procedures, the indexes created where very badly chosen. I dropped around 100 non-clustered indexes and created a few, hand picked ones. Of course insert and updates are working very well now. Also the GUI is very usable now, from taking 10 or more seconds to change a screen or fill up some text boxes to almost instantaneous response, as it should be and was before this version.

Everything seemed fine until I ran it in a test computer. Then hell broke loose Smile | :) .

What I found out is that, just by dropping the non-clustered indexes, a call to a method in a component which calls a stored procedure is causing an ADO time out (ADO error -2147217871 ‘Execution aborted because a resource limit has been reached; no results have been returned’). Before dropping the indexes the call ran fine. If I go to the Com+ application, choose that component and change transactions from required to supported, the problem ‘goes away’ and calling the same method on the same component takes a few seconds. Changing back transactions being to required brings back the problem. I’ve already debugged and jumped to the component where the call is done and the call fails when the stored procedure is executed in ADO, so it is not a problem of the code of the component but somewhat related to Com+ and MTS configuration (or the component use of them), from what I can guess with my limited knowledge and experience.

The stored procedure is quite a complex one which creates a few temporary tables and then builds the returned records from them. In both situations, running the query the component runs in query analyzer, with the same user and against the same server, executes in a few seconds as it should. With the indexes dropped, the query runs FASTER than before.

In brief: before dropping the indexes, the call to the method ran with no problem both with transactions required and supported. After dropping the non-clustered indexes, the call to the method times out when transactions are required, and runs correctly when admited.

My MTS/COM+ and transaction knowledge is very limited, as you can guess – I have no practical knowledge in the field, just checked some books and debugged/modified the COM objects in this application. From what I have said above I can suspect some deadlock/race situation happening when COM+ transaction is happening, but I do not see how this is happening – this is the only call happening at the time, and it calls just one stored procedure. If I change the ADO command timeout, the time until I get the error just changes to reflect this – tried leaving the query running for as long as 10 minutes (which of course, anything over 30 seconds is very unacceptable).

Hope I explained myself well enough. Any help suggestions on how to tackle this problem would be very appreciated.

Thanks,

Juan Miguel Venturello

Edit: after a few hours of playing around, there is just A FEW indexes which I drop and causes the problem Mad | :mad: why is this????
GeneralEvent handing problem. Pin
Prakash Nadar20-Jan-04 17:57
Prakash Nadar20-Jan-04 17:57 
GeneralRe: Event handing problem. Pin
Lim Bio Liong25-Jan-04 17:15
Lim Bio Liong25-Jan-04 17:15 
GeneralRe: Event handing problem. Pin
Prakash Nadar25-Jan-04 22:11
Prakash Nadar25-Jan-04 22:11 
GeneralRe: Event handing problem. Pin
Prakash Nadar26-Jan-04 19:56
Prakash Nadar26-Jan-04 19:56 
GeneralRe: Event handing problem. Pin
Lim Bio Liong26-Jan-04 20:17
Lim Bio Liong26-Jan-04 20:17 
GeneralRe: Event handing problem. Pin
Prakash Nadar27-Jan-04 5:07
Prakash Nadar27-Jan-04 5:07 
GeneralRe: Event handing problem. Pin
Maverick3-Feb-04 20:03
Maverick3-Feb-04 20:03 
GeneralRe: Event handing problem. Pin
Lim Bio Liong4-Feb-04 7:01
Lim Bio Liong4-Feb-04 7:01 
GeneralRe: Event handing problem. Pin
Maverick4-Feb-04 15:54
Maverick4-Feb-04 15:54 
GeneralRe: Event handing problem. Pin
Lim Bio Liong4-Feb-04 17:17
Lim Bio Liong4-Feb-04 17:17 
GeneralRe: Event handing problem. Pin
Lim Bio Liong4-Feb-04 19:49
Lim Bio Liong4-Feb-04 19:49 
GeneralRe: Event handing problem. Pin
Lim Bio Liong4-Feb-04 20:22
Lim Bio Liong4-Feb-04 20:22 
GeneralRe: Event handing problem. Pin
Maverick4-Feb-04 20:57
Maverick4-Feb-04 20:57 
GeneralRe: Event handing problem. Pin
Lim Bio Liong4-Feb-04 23:39
Lim Bio Liong4-Feb-04 23:39 
GeneralRe: Event handing problem. Pin
Maverick5-Feb-04 0:31
Maverick5-Feb-04 0:31 
GeneralRe: Event handing problem. Pin
Lim Bio Liong5-Feb-04 0:48
Lim Bio Liong5-Feb-04 0:48 
GeneralRe: Event handing problem. Pin
Maverick5-Feb-04 15:42
Maverick5-Feb-04 15:42 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.