BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

How to handle EIBInterbaseError "Unassigned code" when conne

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> C++ Builder Databases (InterBase Express)
View previous topic :: View next topic  
Author Message
Max
Guest





PostPosted: Tue Nov 08, 2005 9:58 pm    Post subject: How to handle EIBInterbaseError "Unassigned code" when conne Reply with quote




I have one more question (BCB6 Enterprise on XP). The application
has only one TIBEvents* ibEvent and TIBDatabase* ibDb, which are
created dynamically with the null owner. Everything works ok when
server is ok. However, when I stop the server (application is
running and connection is open), the EIBInterBaseError exception
with the message "Unassigned code" is thrown. This exception is
thrown when application realized that connection to database was
lost (there are many ways to do this) and tries to say:
database->Connected = false. If I did not register ibEvent when
starting, everything is ok. So the problem is here. It did not
matter was ibEvent->AutoRegister = true or false (and handled
"Registred" on my own after connecting every time) at the time
when connection is lost. If I try to say ibEvent->Registered =
false (with or without saying ibEvent->Database = 0, and/or
ibEvent->OnEventAlert = 0) BEFORE saying database->Connected =
false, I have got the same exception. I also tried to define the
event ibEvent->OnError, however, OnError did not catch this
exception. So, the bottom line is I am unable to disconnect from
the database (and threfore delete this database object).
Absolutely the same happens if I try to close the application
after loosing the connection. The exception is thrown when I try
to delete the ibEvent or ibDb. So, I am not able to delete these
objects and close application without memory leak.

Any idea is highly appreciated.
Thanks,
Max
Back to top
Max Fish
Guest





PostPosted: Wed Nov 09, 2005 11:16 pm    Post subject: Re: How to handle EIBInterbaseError "Unassigned code" when c Reply with quote




I almost solved this problem. First, TIBEvents::AutoRegister must be set to false for all TIBEvents, and their registration has to be done manually. Second, before disconnecting from the database (when database server stops) all TIBEvents must be unregistered manually. However, this operation causes the dll to throw the EIBInterBaseError exception with the message "Unassigned code". Workaround is to put this operation for each TIBEvents object in separately the try-catch block with the empty catch:
try{ ibEvent->Registered = false; } catch(...) {}
After that TIBDatabase may be disconnected with no problems.

There is one problem: the EIBInterBaseError exception is caught (see above), but the ibxpress60.bpl opens the "Application Error" dialog with the message "Exception EIBInterBaseError in module ibxpress60.bpl at xxx. Database <database path> shutdown". User has to click on OK button to close it. After that execution continues. The problem is: how could I suppress this dialog that the ibxpress60.bpl opens in order to continue execution automatically?

Max

Back to top
Max Fish
Guest





PostPosted: Wed Nov 09, 2005 11:28 pm    Post subject: Re: How to handle EIBInterbaseError "Unassigned code" when c Reply with quote




I repeat my previous post, because of bad message formatting.

I almost solved this problem. First, TIBEvents::AutoRegister
must be set to false for all TIBEvents, and their registration
has to be done manually. Second, before disconnecting from the
database (when database server is stopped) all TIBEvents must be
unregistered manually. However, this operation causes the dll
to throw the EIBInterBaseError exception with the message
"Unassigned code". Workaround is to put this operation for each
TIBEvents object separately in try-catch block with the
empty catch:

try{ ibEvent->Registered = false; } catch(...) {}

After that TIBDatabase may be disconnected with no problems.

There is one problem: ibxpress60.bpl opens the "Application Error" dialog with the message "Exception EIBInterBaseError in
module ibxpress60.bpl at xxx. Database <database path>
shutdown" after unregistering. User has to click on OK button
to close it. After that execution continues. The problem is:
how could I suppress this dialog that the ibxpress60.bpl opens
in order to continue execution automatically?

Max


Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> C++ Builder Databases (InterBase Express) All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.