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 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 > and another

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

2011-12-08 Thread Jesus Garcia
2011/12/8 Ann Harrison > > An abnormal shutdown for any cause - power failure, O/S crash, > Firebird crash will not corrupt the database if you have forced writes > turned on and if your disk system actually forces writes in the order > they are presented. Connections are transient, in memory en

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

2011-12-08 Thread Ann Harrison
On Thu, Dec 8, 2011 at 9:42 AM, Jesus Garcia wrote: > > 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 an

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 rollba

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 l

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

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 AP

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. --

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

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

2011-12-07 Thread Vlad Khorsun
>> 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. Regards, Vlad -- Cloud Services

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.

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

2011-12-07 Thread Alex Peshkoff
On 12/07/11 14:07, Dimitry Sibiryakov wrote: > 07.12.2011 10:46, Alex Peshkoff wrote: >>> Why do we should add hacks to the new API to support them, now that we have a replacement for it? >> You are absolutely right, I have missed it. >Does this new API handle exceptions thrown from UDR?

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

2011-12-07 Thread Adriano dos Santos Fernandes
On 07/12/2011 08:07, Dimitry Sibiryakov wrote: > 07.12.2011 10:46, Alex Peshkoff wrote: >>> Why do we should add hacks to the new API to support them, now that we have a replacement for it? >> You are absolutely right, I have missed it. > Does this new API handle exceptions thrown from U

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

2011-12-07 Thread Dimitry Sibiryakov
07.12.2011 10:46, Alex Peshkoff wrote: >> Why do we should add hacks to the new API to support them, now that we >> > have a replacement for it? > You are absolutely right, I have missed it. Does this new API handle exceptions thrown from UDR? Even if it is written in different language?.. C

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, >>> do

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 p

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 'pow

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

2011-12-07 Thread Alex Peshkoff
On 12/06/11 21:14, Jesus Garcia wrote: >> >> The only way to have absolutely save UDFs is to run them in separate >> process. But I'm afraid that this will make them work much slower. >> >> Catching unhandled exceptions from foreign module is impossible in >> almost all cases. Code invoking UDFs d

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 runni

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

2011-12-06 Thread Jesus Garcia
> > > The only way to have absolutely save UDFs is to run them in separate > process. But I'm afraid that this will make them work much slower. > > Catching unhandled exceptions from foreign module is impossible in > almost all cases. Code invoking UDFs does catch what it can catch. To > make sure

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

2011-12-05 Thread Alexander Peshkov
В Вс., 04/12/2011 в 17:26 +0100, Jesus Garcia пишет: > > > So UDFs should not raise exceptions. Period. The bug is in it, not > > in > > Firebird. > > > > > May be i don't explain well, i know the bug is in the UDF, but an > exception not catched in my app, would not restart my computer. Yes,

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

2011-12-05 Thread Claudio Valderrama C.
> -Original Message- > From: Jesus Garcia [mailto:jeg...@gmail.com] > Sent: Domingo, 04 de Diciembre de 2011 12:18 > To: For discussion among Firebird Developers > > I know it, and is not me, is firebird. I try To test > everything, but nothing is perfect. One simple example is one > ud

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

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 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 generate

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 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
> > >> 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

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
> So UDFs should not raise exceptions. Period. The bug is in it, not in > Firebird. May be i don't explain well, i know the bug is in the UDF, but an exception not catched in my app, would not restart my computer. > > If your UDF instead write some bytes in random memory places, it will be > e

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 tes

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

2011-12-04 Thread Dimitry Sibiryakov
04.12.2011 16:17, Jesus Garcia wrote: > If you think that one simple thing like this must take down one database > engine, i do not agree What makes you think that "this thing" is a simple one? Have you ever learned how exceptions work "inside"? It's time to start to. PS: Can we make UDF to

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 09:53, Jesus Garcia wrote: > >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

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 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.

[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 cru