Click here to Skip to main content
15,909,827 members
Home / Discussions / COM
   

COM

 
QuestionSystem.__ComObject - how to check null Pin
coolestCoder5-Feb-09 7:13
coolestCoder5-Feb-09 7:13 
QuestionIs there any way to control menus (e.g File--> Save) in Office 2007 documents? Pin
SNI4-Feb-09 23:57
SNI4-Feb-09 23:57 
AnswerRe: Is there any way to control menus (e.g File--> Save) in Office 2007 documents? Pin
frx9616-Feb-09 18:49
frx9616-Feb-09 18:49 
QuestionSuggestions on OLE DB architecture [modified] Pin
robocodeboy4-Feb-09 6:12
robocodeboy4-Feb-09 6:12 
AnswerRe: Suggestions on OLE DB architecture Pin
Baltoro9-Feb-09 7:18
Baltoro9-Feb-09 7:18 
GeneralRe: Suggestions on OLE DB architecture Pin
robocodeboy10-Feb-09 4:15
robocodeboy10-Feb-09 4:15 
GeneralRe: Suggestions on OLE DB architecture Pin
Baltoro14-Feb-09 12:02
Baltoro14-Feb-09 12:02 
QuestionADO _ConnectionPtr still throwing even after reopening connection [modified] Pin
Dexterus4-Feb-09 3:33
Dexterus4-Feb-09 3:33 
I've just encountered a bit of an issue while trying to do some sort of automatic recovery from a MySQL server crash to a C++ app.

Basicly, once I catch a DB_E_ABORTLIMITREACHED somewhere in the app I set an event to perform a ->Close() and ->Open() (in a separate thread) and check if that worked OK. I keep doing this for each throw with the above error.

Problem comes up when the Open() is theoretically ok again, all other apps that rely on that server are properly working with it again but any attempt at calling ->Execute() keeps throwing the same thing.

Has anyone encountered this behaviour before and could shed some light on why and maybe how to fix?

PS: After about 5 minutes of throwing that exception (after I restart MySQL that is) stuff miraculously starts working again, no more exceptions.
PS2: Also tried clearing Errors, there aren't any there it seems.

Here's a bit of code that might make things more clear:
_ConnectionPtr pConn;
// Some method in the app:
try
{
    pConn->Execute(...); // doing this while MySQL went kaboom leads to a _com_error being thrown
}
catch (_com_error &e)
{
    switch (e.Error())
    {
        case DB_E_ABORTLIMITREACHED:
            SetEvent(hReconnectDBEvent);
            break;
    }
...
}

// Connection thread:
while (keepChecking)
{
    waitRes = WaitForMultipleObjects(..., 30000); // App exit, DB reconnect, half the db connection timeout
    switch (waitRes)
    {
        case WAIT_OBJECT_the_reconnect_event:
            if (pConn->State == adStateOpen)
            {
                pConn->Close();
            }
            pConn->Open(...); // returns 0 when MySQL is back up
            
            break;
    }
}

Once connection is reopened ok attempts to Execute something still throw that exception for about 5 more minutes. After that everything returns back to normal.



Last modified: 1hr 5mins after originally posted -- clarification, code



AnswerRe: ADO _ConnectionPtr still throwing even after reopening connection Pin
Rajasekharan Vengalil4-Feb-09 4:35
Rajasekharan Vengalil4-Feb-09 4:35 
GeneralRe: ADO _ConnectionPtr still throwing even after reopening connection Pin
Dexterus4-Feb-09 4:46
Dexterus4-Feb-09 4:46 
GeneralRe: ADO _ConnectionPtr still throwing even after reopening connection Pin
Rajasekharan Vengalil4-Feb-09 5:08
Rajasekharan Vengalil4-Feb-09 5:08 
QuestionHow to transfer the Serialport settings in Form design to another Form Design in visualbasic2005 Pin
vidyashankar3-Feb-09 20:08
vidyashankar3-Feb-09 20:08 
QuestionRe: How to transfer the Serialport settings in Form design to another Form Design in visualbasic2005 Pin
Jonathan Davies4-Feb-09 0:42
Jonathan Davies4-Feb-09 0:42 
QuestionHow to append text in winword document caption? Pin
SNI2-Feb-09 23:35
SNI2-Feb-09 23:35 
AnswerRe: How to append text in winword document caption? Pin
Rajasekharan Vengalil4-Feb-09 6:21
Rajasekharan Vengalil4-Feb-09 6:21 
QuestionProblem with VC++ OCX in VB6.0 Pin
chetanjoshi92-Feb-09 20:11
chetanjoshi92-Feb-09 20:11 
QuestionRe: Problem with VC++ OCX in VB6.0 Pin
Roger Stoltz2-Feb-09 21:41
Roger Stoltz2-Feb-09 21:41 
QuestionRe: pass VB6 array to C# dll Pin
mla1542-Feb-09 7:07
mla1542-Feb-09 7:07 
AnswerRe: pass VB6 array to C# dll Pin
mla1542-Feb-09 9:00
mla1542-Feb-09 9:00 
QuestionDRM (Digital right management) and WMP (Window media player) throw error Retrieving the COM class factory Pin
Asit Kumar Sinha2-Feb-09 2:59
Asit Kumar Sinha2-Feb-09 2:59 
QuestionNullReference exception - INetCfg AquireWriteLock Pin
pfrances31-Jan-09 13:54
pfrances31-Jan-09 13:54 
AnswerRe: NullReference exception - INetCfg AquireWriteLock Pin
Randor 1-Feb-09 11:34
professional Randor 1-Feb-09 11:34 
QuestionDecoding base64 to generate png image Pin
Rajiya29-Jan-09 17:55
Rajiya29-Jan-09 17:55 
AnswerRe: Decoding base64 to generate png image Pin
«_Superman_»29-Jan-09 20:53
professional«_Superman_»29-Jan-09 20:53 
QuestionHelp needed on Interop activeX C# contro access from VB 6.0 Pin
sanvisanvi29-Jan-09 2:55
sanvisanvi29-Jan-09 2:55 

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.