Re: [firebird-support] udf dll

2018-12-12 Thread Robert Tulloch tult...@hughes.net [firebird-support]
On 12/12/2018 2:04 PM, Dimitry Sibiryakov s...@ibphoenix.com 
[firebird-support] wrote:

12.12.2018 19:26, Robert Tulloch tult...@hughes.net [firebird-support] wrote:

Not using firebird at all.

In this case you are in wrong support list.



There is no other support list


Re: [firebird-support] udf dll

2018-12-12 Thread Robert Tulloch tult...@hughes.net [firebird-support]
On 12/12/2018 2:04 PM, Dimitry Sibiryakov s...@ibphoenix.com 
[firebird-support] wrote:

12.12.2018 19:26, Robert Tulloch tult...@hughes.net [firebird-support] wrote:

Not using firebird at all.

In this case you are in wrong support list.



Hi:

  Never mind the dll/udf

Statement:

SELECT cast (RDB$RELATION_NAME as varchar(32)) AS TABLE_NAME,cast 
(RDB$INDEX_NAME as varchar(32)) AS INDEX_NAME, RDB$STATISTICS from 
rdb$indices  WHERE rdb$system_flag = 0 order by RDB$STATISTICS



rdb$system_flag is 0 for user defind indexes and 1 and greater for 
system indexes.


If I code WHERE 0 = 0 order by RDB$STATISTICS

I get everything in result set but with WHERE rdb$system_flag = 0 I get 
nothing.


Why would that be since rdb$system_flag should return 0 or 1
Thanks from out lander.

Robert


Re: [firebird-support] udf dll

2018-12-12 Thread Dimitry Sibiryakov s...@ibphoenix.com [firebird-support]
12.12.2018 19:26, Robert Tulloch tult...@hughes.net [firebird-support] wrote:
> Not using firebird at all.

   In this case you are in wrong support list.


-- 
   WBR, SD.






++

Visit http://www.firebirdsql.org and click the Documentation item
on the main (top) menu.  Try FAQ and other links from the left-side menu there.

Also search the knowledgebases at http://www.ibphoenix.com/resources/documents/ 

++


Yahoo Groups Links

<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/firebird-support/

<*> Your email settings:
Individual Email | Traditional

<*> To change settings online go to:
http://groups.yahoo.com/group/firebird-support/join
(Yahoo! ID required)

<*> To change settings via email:
firebird-support-dig...@yahoogroups.com 
firebird-support-fullfeatu...@yahoogroups.com

<*> To unsubscribe from this group, send an email to:
firebird-support-unsubscr...@yahoogroups.com

<*> Your use of Yahoo Groups is subject to:
https://info.yahoo.com/legal/us/yahoo/utos/terms/



Re: [firebird-support] Re: very slow firebird embedded connection on a web application

2018-12-12 Thread Dimitry Sibiryakov s...@ibphoenix.com [firebird-support]
12.12.2018 20:03, Mark Rotteveel m...@lawinegevaar.nl [firebird-support] wrote:
> What optimization advantages are you thinking of?

   Result set buffering can significantly speed up fetch.

-- 
   WBR, SD.






++

Visit http://www.firebirdsql.org and click the Documentation item
on the main (top) menu.  Try FAQ and other links from the left-side menu there.

Also search the knowledgebases at http://www.ibphoenix.com/resources/documents/ 

++


Yahoo Groups Links

<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/firebird-support/

<*> Your email settings:
Individual Email | Traditional

<*> To change settings online go to:
http://groups.yahoo.com/group/firebird-support/join
(Yahoo! ID required)

<*> To change settings via email:
firebird-support-dig...@yahoogroups.com 
firebird-support-fullfeatu...@yahoogroups.com

<*> To unsubscribe from this group, send an email to:
firebird-support-unsubscr...@yahoogroups.com

<*> Your use of Yahoo Groups is subject to:
https://info.yahoo.com/legal/us/yahoo/utos/terms/



Re: [firebird-support] Re: very slow firebird embedded connection on a web application

2018-12-12 Thread Mark Rotteveel m...@lawinegevaar.nl [firebird-support]
On 2018-12-12 17:54, blackfalconsoftw...@outlook.com [firebird-support] 
wrote:
> May I ask why you are using the embedded version of Firebird for a web
> application?
> 
> This version of Firebird does not have the optimization advantages of
> the server version, even if it is using the same core kernel...

What optimization advantages are you thinking of? The engine used by 
Firebird server is identical to Firebird embedded (in Firebird 3 it is 
even the exact same .so/.dll). The only real difference is that one can 
accept connections from external processes, and the other can only be 
used in the same process.

Mark


ODP: [firebird-support] Re: very slow firebird embedded connection on a web application

2018-12-12 Thread Karol Bieniaszewski liviusliv...@poczta.onet.pl [firebird-support]
>> May I ask why you are using the embedded version of Firebird for a web 
>> application? 

I suppose he use shared hosting and have not possibility to run full server..
I do this self many times.

Regards,
Karol Bieniaszewski


Re: [firebird-support] udf dll

2018-12-12 Thread Robert Tulloch tult...@hughes.net [firebird-support]
On 12/12/2018 12:34 PM, Dimitry Sibiryakov s...@ibphoenix.com 
[firebird-support] wrote:

12.12.2018 18:05, Robert Tulloch tult...@hughes.net [firebird-support] wrote:

Error message when run from program in IDE
First chance exception at $7C812FD3 . Exception class EIBInterBaseError with 
message
'Unable to complete network request to host "ws1".
Error writing data to the connection.

Your UDF crashed server most likely.


An established connection was aborted by the software in your host machine.

10053? Wow... What is exact version of client library was in use?


'. Process IBConsole.exe ($A54)

This is an Interbase client tool, not Firebird one. Do you by chance try to 
use
Interbase client library to access Firebird server? This is no-go.


Explain:

Not using firebird at all.

Used IB 6 (6.0.2.0) for many years. Old apps D5/BCB5 (hobby).

Installed BCB5 app I did in 2000 on Win10. All worked fine.Went to 
githgub and downloaded source for console and decided to put it back 
together with enhancements (hobby like model airplanes).


Integrating Planalyzer into IBConsole. 50% there maybe.

Did not have COELESCE() in IB 6 so wrote new UDF to perform function 
thus the crash.


As I said in previous post:

Stepped to error block

function TIBTransaction.Call(ErrCode: ISC_STATUS;
  RaiseError: Boolean): ISC_STATUS;
var
  i: Integer;
begin
  result := ErrCode;
  for i := 0 to FDatabases.Count - 1 do if FDatabases[i] <> nil then
    Databases[i].FCanTimeout := False;
  FCanTimeout := False;
  {*Handle when the Error is due to a Database disconnect*. Pass it on to
   FDatabase so it can handle this}
  if CheckStatusVector([isc_lost_db_connection]) then
    FDefaultDatabase.Call(ErrCode, RaiseError)
  else
    if RaiseError and (result > 0) then
  IBDataBaseError;
end;

Why it disconnects? Who knows but I will track it down.







Re: [firebird-support] udf dll

2018-12-12 Thread Robert Tulloch tult...@hughes.net [firebird-support]
On 12/12/2018 12:17 PM, Robert Tulloch tult...@hughes.net 
[firebird-support] wrote:


On 12/12/2018 12:05 PM, Robert Tulloch wrote:
On 12/12/2018 11:00 AM, Dimitry Sibiryakov s...@ibphoenix.com 
[firebird-support] wrote:

12.12.2018 16:45, Robert tullochtult...@hughes.net  [firebird-support] wrote:

Interesting last message.

Binaries are not allowed in this list. Use Ctrl-C to copy error message 
text and Ctrl-V
to paste it into mail directly.
If you use Windows command-line console, "select" and "copy" commands are 
in system menu.
Code calling your SQL is useless for diagnostic UDF errors (unless this 
query is
executed in isql w/o error). UDF code and its declaration are useful.

I did execute the statement in ISQL for testing (outside of my 
program) and got the error messages the image of which were deleted.



Error message when run from program in IDE
First chance exception at $7C812FD3 . Exception class 
EIBInterBaseError with message 'Unable to complete network request to 
host "ws1".

Error writing data to the connection.
An established connection was*aborted by the software in your host 
machine*.

'. Process IBConsole.exe ($A54)


Stepped to error block

function TIBTransaction.Call(ErrCode: ISC_STATUS;
  RaiseError: Boolean): ISC_STATUS;
var
  i: Integer;
begin
  result := ErrCode;
  for i := 0 to FDatabases.Count - 1 do if FDatabases[i] <> nil then
    Databases[i].FCanTimeout := False;
  FCanTimeout := False;
  {Handle when the Error is due to a Database disconnect.  Pass it on to
   FDatabase so it can handle this}
  if CheckStatusVector([isc_lost_db_connection]) then
    FDefaultDatabase.Call(ErrCode, RaiseError)
  else
    if RaiseError and (result > 0) then
  IBDataBaseError;
end;


Re: [firebird-support] udf dll

2018-12-12 Thread Dimitry Sibiryakov s...@ibphoenix.com [firebird-support]
12.12.2018 18:05, Robert Tulloch tult...@hughes.net [firebird-support] wrote:
> Error message when run from program in IDE
> First chance exception at $7C812FD3 . Exception class EIBInterBaseError with 
> message 
> 'Unable to complete network request to host "ws1".
> Error writing data to the connection.

   Your UDF crashed server most likely.

> An established connection was aborted by the software in your host machine.

   10053? Wow... What is exact version of client library was in use?

> '. Process IBConsole.exe ($A54)

   This is an Interbase client tool, not Firebird one. Do you by chance try to 
use 
Interbase client library to access Firebird server? This is no-go.

-- 
   WBR, SD.






++

Visit http://www.firebirdsql.org and click the Documentation item
on the main (top) menu.  Try FAQ and other links from the left-side menu there.

Also search the knowledgebases at http://www.ibphoenix.com/resources/documents/ 

++


Yahoo Groups Links

<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/firebird-support/

<*> Your email settings:
Individual Email | Traditional

<*> To change settings online go to:
http://groups.yahoo.com/group/firebird-support/join
(Yahoo! ID required)

<*> To change settings via email:
firebird-support-dig...@yahoogroups.com 
firebird-support-fullfeatu...@yahoogroups.com

<*> To unsubscribe from this group, send an email to:
firebird-support-unsubscr...@yahoogroups.com

<*> Your use of Yahoo Groups is subject to:
https://info.yahoo.com/legal/us/yahoo/utos/terms/



ODP: [firebird-support] udf dll

2018-12-12 Thread Karol Bieniaszewski liviusliv...@poczta.onet.pl [firebird-support]
I suppose you do some wrong things like:
1. Wrong calling convention – should by „cdecl” not „stdcall”
2. You allocate strings locally and return it to the engine but you should 
allocate it by „ib_util_malloc”.
3. Your declaration of udf is wrong.
4. You raise some exceptions inside your udf
…..

regards,
Karol Bieniaszewski


Re: [firebird-support] very slow firebird embedded connection on a web application

2018-12-12 Thread Issam Boughanmi amigof...@gmail.com [firebird-support]
yep this mean that i am right about my  connection issue :p

i have also tried without including localhost or any iP .

 i am for 3 days now with this thing and tried almost any combination
except the good one :/

Le mer. 12 déc. 2018 à 18:11, Dimitry Sibiryakov s...@ibphoenix.com
[firebird-support]  a écrit :

> 12.12.2018 17:18, Issam Boughanmi amigof...@gmail.com [firebird-support]
> wrote:
> > also sometimes i have a Network Error (tcp_error)  during my various
> tests changes .
>
>It means that you are wrong in your assumption about using of an
> embedded engine.
>
>And your connection string confirms that by mentioning "localhost".
> embed.dll can work
> as an ordinary client library, you know...
>
>
> --
>WBR, SD.
>
>
> 
>
> 
>
> ++
>
> Visit http://www.firebirdsql.org and click the Documentation item
> on the main (top) menu.  Try FAQ and other links from the left-side menu
> there.
>
> Also search the knowledgebases at
> http://www.ibphoenix.com/resources/documents/
>
> ++
> 
>
> Yahoo Groups Links
>
>
>
>


Re: [firebird-support] udf dll

2018-12-12 Thread Robert Tulloch tult...@hughes.net [firebird-support]

On 12/12/2018 12:05 PM, Robert Tulloch wrote:
On 12/12/2018 11:00 AM, Dimitry Sibiryakov s...@ibphoenix.com 
[firebird-support] wrote:

12.12.2018 16:45, Robert tullochtult...@hughes.net  [firebird-support] wrote:

Interesting last message.

Binaries are not allowed in this list. Use Ctrl-C to copy error message 
text and Ctrl-V
to paste it into mail directly.
If you use Windows command-line console, "select" and "copy" commands are 
in system menu.
Code calling your SQL is useless for diagnostic UDF errors (unless this 
query is
executed in isql w/o error). UDF code and its declaration are useful.

I did execute the statement in ISQL for testing (outside of my 
program) and got the error messages the image of which were deleted.



Error message when run from program in IDE
First chance exception at $7C812FD3 . Exception class 
EIBInterBaseError with message 'Unable to complete network request to 
host "ws1".

Error writing data to the connection.
An established connection was*aborted by the software in your host 
machine*.

'. Process IBConsole.exe ($A54)

Obviously something I cannot expect help with based on my emails.

Best regards




The statement do prepare

Statement: SELECT cast (RDB$RELATION_NAME as varchar(32)) AS TABLE_NAME, 
cast (RDB$INDEX_NAME as varchar(32)) AS
INDEX_NAME, RDB$STATISTICS from rdb$indices WHERE sNullIf( cast( 
rdb$system_flag as VARCHAR(32) ),  cast( 0 as VARCHAR

(32) ) ) = 0 order by RDB$STATISTICS
PLAN SORT ((RDB$INDICES NATURAL))


Re: [firebird-support] udf dll

2018-12-12 Thread Robert Tulloch tult...@hughes.net [firebird-support]
On 12/12/2018 11:00 AM, Dimitry Sibiryakov s...@ibphoenix.com 
[firebird-support] wrote:

12.12.2018 16:45, Robert Tulloch tult...@hughes.net [firebird-support] wrote:

Interesting last message.

Binaries are not allowed in this list. Use Ctrl-C to copy error message 
text and Ctrl-V
to paste it into mail directly.
If you use Windows command-line console, "select" and "copy" commands are 
in system menu.
Code calling your SQL is useless for diagnostic UDF errors (unless this 
query is
executed in isql w/o error). UDF code and its declaration are useful.

I did execute the statement in ISQL for testing (outside of my program) 
and got the error messages the image of which were deleted.



Error message when run from program in IDE
First chance exception at $7C812FD3 . Exception class EIBInterBaseError 
with message 'Unable to complete network request to host "ws1".

Error writing data to the connection.
An established connection was*aborted by the software in your host machine*.
'. Process IBConsole.exe ($A54)

Obviously something I cannot expect help with based on my emails.

Best regards





[firebird-support] Re: very slow firebird embedded connection on a web application

2018-12-12 Thread blackfalconsoftw...@outlook.com [firebird-support]
May I ask why you are using the embedded version of Firebird for a web 
application?  
 

 This version of Firebird does not have the optimization advantages of the 
server version, even if it is using the same core kernel...
 

 Steve Naidamast
 Sr. Software Engineer



Re: [firebird-support] very slow firebird embedded connection on a web application

2018-12-12 Thread Issam Boughanmi amigof...@gmail.com [firebird-support]
just an assumption , but :

basically i have two actions in my test method :
- open the database with the dynamic connectionstring
- run a simple count(*) query on a table that contain 3 rows .

also sometimes i have a Network Error (tcp_error)  during my various tests
changes .


and like i said it work fine locally.
btw i have fb 2.5 installed on my local machine , but i stop the service
when i want to test the embedded version .

also on the web application i set the lock destination directory with some
environement variable .
Environment.SetEnvironmentVariable("FIREBIRD", env.ContentRootPath);
Environment.SetEnvironmentVariable("FIREBIRD_LOCK",
Path.Combine(env.ContentRootPath, @"fblock\"));
when i run the web application some empty trace files are created on that
folder , so the embed lib is found but take a long long time to get
data from the database or have a tcp_error message .

can you check if my connectionstring is correct please :
 @"Datasource=localhost;initial catalog=h:\fullpath\database.fdb;server
type=1;user id=SYSDBA;character set=UTF8;pooling=False;client
library=h:\fullpath\embed.dll";

(i have tried lot of variants )

the fb version i am using is :
Firebird-2.5.8.27089-0_x64_embed


Re: [firebird-support] udf dll

2018-12-12 Thread Dimitry Sibiryakov s...@ibphoenix.com [firebird-support]
12.12.2018 16:45, Robert Tulloch tult...@hughes.net [firebird-support] wrote:
> Interesting last message.

   Binaries are not allowed in this list. Use Ctrl-C to copy error message text 
and Ctrl-V 
to paste it into mail directly.
   If you use Windows command-line console, "select" and "copy" commands are in 
system menu.
   Code calling your SQL is useless for diagnostic UDF errors (unless this 
query is 
executed in isql w/o error). UDF code and its declaration are useful.

-- 
   WBR, SD.






++

Visit http://www.firebirdsql.org and click the Documentation item
on the main (top) menu.  Try FAQ and other links from the left-side menu there.

Also search the knowledgebases at http://www.ibphoenix.com/resources/documents/ 

++


Yahoo Groups Links

<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/firebird-support/

<*> Your email settings:
Individual Email | Traditional

<*> To change settings online go to:
http://groups.yahoo.com/group/firebird-support/join
(Yahoo! ID required)

<*> To change settings via email:
firebird-support-dig...@yahoogroups.com 
firebird-support-fullfeatu...@yahoogroups.com

<*> To unsubscribe from this group, send an email to:
firebird-support-unsubscr...@yahoogroups.com

<*> Your use of Yahoo Groups is subject to:
https://info.yahoo.com/legal/us/yahoo/utos/terms/



[firebird-support] udf dll

2018-12-12 Thread Robert Tulloch tult...@hughes.net [firebird-support]

Hi

   My udf is not working. Very strange error message. Exciting challenges



I execute any old SQL statement and Ok.

Run this and not ok.

SELECT cast (RDB$RELATION_NAME as varchar(32)) AS TABLE_NAME, cast 
(RDB$INDEX_NAME as varchar(32)) AS INDEX_NAME, RDB$STATISTICS from 
rdb$indices WHERE sNullIf( cast( rdb$system_flag as VARCHAR(32) ),  
cast( 0 as VARCHAR(32) ) ) = 0 order by RDB$STATISTICS

This sNullIf( cast( rdb$system_flag as VARCHAR(32) ),  cast( 0 as 
VARCHAR(32) ) ) = 0  is calling my udf dll

code:
     setStatisticsStatement := 'SELECT cast (RDB$RELATION_NAME as 
varchar(32)) AS TABLE_NAME, ' +
    'cast (RDB$INDEX_NAME as varchar(32)) AS INDEX_NAME, ' +
    'RDB$STATISTICS from rdb$indices ' +
    'WHERE sNullIf( cast( rdb$system_flag as VARCHAR(32) ),  cast( 0 
as VARCHAR(32) ) ) = 0 order by RDB$STATISTICS';

     dmQuery.sqlSetStatistics.SQL.Text := setStatisticsStatement;
     dmQuery.sqlSetStatistics.ExecQuery;
*dmQuery.trxIndices.Commit; 
<*
     dmQuery.trxIndices.Active := false;

When I click prepare in SQL, no errors.

No result in SQL from execute.


2 error messages from execute after prepare Ok. Had to shut down with 
task manager. Transaction active. I issue commit and it won't shut the 
process down.





Interesting last message. Perhaps commit while long process executing?

Stepping through code now. A long process.

Any insight based on error messages appreciated.

Robert




[Non-text portions of this message have been removed]



Re: [firebird-support] very slow firebird embedded connection on a web application

2018-12-12 Thread liviuslivius liviusliv...@poczta.onet.pl [firebird-support]
Hi,
did you checked this or is this your assumption?

Regards,Karol Bieniaszewski
null