 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
Max Guest
|
Posted: Tue Nov 08, 2005 9:58 pm Post subject: How to handle EIBInterbaseError "Unassigned code" when conne |
|
|
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
|
Posted: Wed Nov 09, 2005 11:16 pm Post subject: Re: How to handle EIBInterbaseError "Unassigned code" when c |
|
|
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
|
Posted: Wed Nov 09, 2005 11:28 pm Post subject: Re: How to handle EIBInterbaseError "Unassigned code" when c |
|
|
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 |
|
 |
|
|
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
|
|