Re: [Firebird-devel] Database shutdown when udf raises an exception

2011-12-08 Thread Jesus Garcia
Does engine shutdown or die on AV in your case? I'm talking About fb 2.5. When i test with it, an AV raises and the engine shutdown abnormally. The question is If an error in the engine that causes fb terminate abnormally can corrupt database or the engine closes all connections and

Re: [Firebird-devel] Database shutdown when udf raises an exception

2011-12-08 Thread Ann Harrison
On Thu, Dec 8, 2011 at 3:19 PM, Jesus Garcia jeg...@gmail.com wrote: If using superserver, when the abnormally shutdown starts, if another thread is committing and updating a big amount of pages of several types, the commit process can be terminated without finish, and some pages are writen

Re: [Firebird-devel] Database shutdown when udf raises an exception

2011-12-07 Thread Alex Peshkoff
On 12/05/11 04:23, Geoff Worboys wrote: So the power example would become: declare external function dPower double precision by descriptor, double precision by descriptor, double precision by descriptor, integer by descriptor returns parameter 3 returns exception 4 entry_point 'power'

Re: [Firebird-devel] Database shutdown when udf raises an exception

2011-12-07 Thread Adriano dos Santos Fernandes
On 07/12/2011 07:31, Alex Peshkoff wrote: On 12/05/11 04:23, Geoff Worboys wrote: So the power example would become: declare external function dPower double precision by descriptor, double precision by descriptor, double precision by descriptor, integer by descriptor returns parameter 3

Re: [Firebird-devel] Database shutdown when udf raises an exception

2011-12-07 Thread Alex Peshkoff
On 12/07/11 13:39, Adriano dos Santos Fernandes wrote: On 07/12/2011 07:31, Alex Peshkoff wrote: On 12/05/11 04:23, Geoff Worboys wrote: So the power example would become: declare external function dPower double precision by descriptor, double precision by descriptor, double precision by

Re: [Firebird-devel] Database shutdown when udf raises an exception

2011-12-07 Thread Dimitry Sibiryakov
07.12.2011 11:15, Adriano dos Santos Fernandes wrote: Even if it is written in different language?.. Could you provide example engine handling exception raised in Delphi UDR?.. Could you provide example of UDR in Delphi at all?.. I expect the Delphi people will work on it. No way,

Re: [Firebird-devel] Database shutdown when udf raises an exception

2011-12-07 Thread Pierre Y.
I expect the Delphi people will work on it.   No way, I'm afraid. I'm quite good in Delphi, but I have no idea how to convert C++ classes to Delphi classes.    I can help. I'm very interrested in seeing how to use the new Firebird OO API in Delphi. We gave it a try two weeks ago and we

Re: [Firebird-devel] Database shutdown when udf raises an exception

2011-12-07 Thread Dimitry Sibiryakov
07.12.2011 11:40, Vlad Khorsun wrote: No way, I'm afraid. I'm quite good in Delphi, but I have no idea how to convert C++ classes to Delphi classes. I can help. I would prefer to leave this task to the author of the API. Just to make him to think twice next time. -- SY,

Re: [Firebird-devel] Database shutdown when udf raises an exception

2011-12-07 Thread Vlad Khorsun
I can help. I'm very interrested in seeing how to use the new Firebird OO API in Delphi. We gave it a try two weeks ago and we only succeeded with the getVersion() function ! Everything else generated errors or access violations. Could you send to me your Delphi wrapper for the API ?

Re: [Firebird-devel] Database shutdown when udf raises an exception

2011-12-07 Thread Alex Peshkoff
On 12/07/11 14:54, Pierre Y. wrote: I expect the Delphi people will work on it. No way, I'm afraid. I'm quite good in Delphi, but I have no idea how to convert C++ classes to Delphi classes. I can help. I'm very interrested in seeing how to use the new Firebird OO API in Delphi. We

Re: [Firebird-devel] Database shutdown when udf raises an exception

2011-12-07 Thread Pierre Y.
I'm very interrested in seeing how to use the new Firebird OO API in Delphi. We gave it a try two weeks ago and we only succeeded with the getVersion() function ! Everything else generated errors or access violations.    Could you send to me your Delphi wrapper for the API ?  I'll look at

Re: [Firebird-devel] Database shutdown when udf raises an exception

2011-12-06 Thread Jesus Garcia
UDF installation is restricted to administrators, for the same reason. The UDF directory is restricted, too. An UDF is simply a library that runs as native code in the same address space as the FB process. Big problem if it misbehaves. Maybe the problem could be isolated better by running in

[Firebird-devel] Database shutdown when udf raises an exception

2011-12-04 Thread Jesus Garcia
Hello all, i wrote time ago this item in the firebird-support list, but vlad suggest to write it in the devel list. The question is that doing some test, i use one udf function in one dll that raises an exception that the function did not catch. When that exception raised, the firebird engine

Re: [Firebird-devel] Database shutdown when udf raises an exception

2011-12-04 Thread Dimitry Sibiryakov
04.12.2011 10:28, Jesus Garcia wrote: why instead crush the engine when an exception is raised, the engine would catch it and write in the log the error? How??? How the engine catch an alien exception? Could you show the method working in MSVC and GCC? -- SY, SD.

Re: [Firebird-devel] Database shutdown when udf raises an exception

2011-12-04 Thread Jesus Garcia
How??? How the engine catch an alien exception? Could you show the method working in MSVC and GCC? I don,t know how and if is possible, There must be a point in firebird where a call to an udf in a dll is executed, and i don't know if is possible to catch an exception that is raised in

Re: [Firebird-devel] Database shutdown when udf raises an exception

2011-12-04 Thread Jesus Garcia
The engine does what is possible and tries to catch the 'alien exception'. You must do your part and write a correct UDF, testing them before in non-production environment. Adriano I know it, and is not me, is firebird. I try To test everything, but nothing is perfect. One simple

Re: [Firebird-devel] Database shutdown when udf raises an exception

2011-12-04 Thread Adriano dos Santos Fernandes
On 04-12-2011 13:17, Jesus Garcia wrote: The engine does what is possible and tries to catch the 'alien exception'. You must do your part and write a correct UDF, testing them before in non-production environment. Adriano I know it, and is not me, is firebird. I try To test everything,

Re: [Firebird-devel] Database shutdown when udf raises an exception

2011-12-04 Thread Dimitry Sibiryakov
04.12.2011 17:26, Jesus Garcia wrote: an exception not catched in my app, would not restart my computer. But it will make OS to close your application harshly. Exactly as it is done with Firebird. -- SY, SD.

Re: [Firebird-devel] Database shutdown when udf raises an exception

2011-12-04 Thread Jesus Garcia
an exception not catched in my app, would not restart my computer. But it will make OS to close your application harshly. Exactly as it is done with Firebird. -- My example was not a good example, i knew it Just after pressing send button. But what i don't understand is that i

Re: [Firebird-devel] Database shutdown when udf raises an exception

2011-12-04 Thread Dimitry Sibiryakov
04.12.2011 17:51, Jesus Garcia wrote: but i Only have had responses like learn more, learn to write udf, etc Because every programmer know that exceptions can hardly pass boundaries of DLL. Now it is time for you to learn it too. -- SY, SD.

Re: [Firebird-devel] Database shutdown when udf raises an exception

2011-12-04 Thread Jesus Garcia
Because every programmer know that exceptions can hardly pass boundaries of DLL. Now it is time for you to learn it too. Thank you very much for the lesson, but you say can hardly not can't. Sorry for the post and for waste your valuable time with me. Jesus

Re: [Firebird-devel] Database shutdown when udf raises an exception

2011-12-04 Thread Dimitry Sibiryakov
04.12.2011 18:07, Jesus Garcia wrote: you say can hardly not can't. Right. But I'm not going to describe how many stars must have right positions to allow that. -- SY, SD. -- All the data continuously

Re: [Firebird-devel] Database shutdown when udf raises an exception

2011-12-04 Thread Jesus Garcia
Right. But I'm not going to describe how many stars must have right positions to allow that. Thank you again for the lesson, i did never link the positions of thr stars with programming, but i'll take it into account the next time. Jesus

Re: [Firebird-devel] Database shutdown when udf raises an exception

2011-12-04 Thread Geoff Worboys
First off to say that I fully agree that a UDF must not let exceptions escape. I have no issue with that. Claudio says in the v2.1.4 release notes: Since UDFs have no formal mechanism to signal errors, the returned value would have to be used as an indicator. I was wondering if anyone had had