[firebird-support] Re: Firebird and sharding ? - Email found in subject

2012-03-30 Thread nathanelrick
> > and yes you are right they move their C++/ISAPI to JAVA :) by the way
> that
> > a curious choice ...
> 
> Why would that be a curious choice?

because they already have hundred of developer working on the c++ isapi, 
thousands of thousands lines of code, why move all of them to java (exept if 
the c++ code was really bad or all their c++ developer resignate suddenly) ? 
they also need to "fire" all their c++ developper to find new java developper 
and i don't think java is "soo" good to make such jump



[firebird-support] how to use the x notation (ex ID=x'049094') inside parameter ?

2012-03-30 Thread nathanelrick
Hello,

how to use the x notation (ex ID=x'049094') inside parameter ?

When i do

insert into ... (Field1) Values (?); 
with the parameter x'049094' i receive an error
probably i can write any char i want (from #0 to #255) inside parameter and i 
don't need the x notation ?



Re: [firebird-support] Re: Firebird and sharding ? - Email found in subject

2012-03-30 Thread Kjell Rilbe
Den 2012-03-30 09:04 skrev nathanelrick såhär:
>
> > > and yes you are right they move their C++/ISAPI to JAVA :) by the way
> > that
> > > a curious choice ...
> >
> > Why would that be a curious choice?
>
> because they already have hundred of developer working on the c++ 
> isapi, thousands of thousands lines of code, why move all of them to 
> java (exept if the c++ code was really bad or all their c++ developer 
> resignate suddenly) ? they also need to "fire" all their c++ 
> developper to find new java developper and i don't think java is "soo" 
> good to make such jump
>

Ah, but maybe C++ is "soo" *bad*...?

Sorry, couldn't resist. :-)

Kjell

-- 
--
Kjell Rilbe
DataDIA AB
E-post: kj...@datadia.se
Telefon: 08-761 06 55
Mobil: 0733-44 24 64



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





++

Visit http://www.firebirdsql.org and click the Resources item
on the main (top) menu.  Try Knowledgebase and FAQ links !

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

++
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:
http://docs.yahoo.com/info/terms/



[firebird-support] an existing connection was forcibly closed by the remote host

2012-03-30 Thread homerjones1941
I've searched this subject in this group and others. It seems there is
no single cause for this. Even so, I would welcome any input. This seems
to be a common problem with other RDBMS as well, so I'm sure it isn't a
Firebird problem, but perhaps there is some "setting" I've overlooked. I
still consider myself a Firebird novice.
Server: Windows XP with all updates current.Database: Firebird 2.1Client
1: Windows 7 - 64 bit  Intel I7  - Wireless connectionClient 2: Windows
XP 32 bit  AMD Dual Core  - Wired connection (this is not the
server).Language: Delphi 2007  - Data access via IBDAC components
(devart).
Application: Customer lookup and support data.The program normally has
only one table open using an IBDAC Query component. The data is
displayed one record at a time (not a grid).  There are a good number of
other tables, but they are not open when this problem occurs.
Condition/Symptom: Within 15 or 20 seconds of opening the database, the
program freezes for a short period before returning the error: "... an
existing connection was forcibly closed by the remote host."  This
happens while navigating from one record to the next. It also happens in
the same amount of time when sitting idle.Examination of
Firebird.log shows multiple coinsurances of :
MYCOMPUTERNAME (Server) Thu Mar 29 18:11:06 2012 INET/inet_error: send
errno = 10054
MYCOMPUTERNAME (Server) Thu Mar 29 18:19:03 2012 INET/inet_error: read
errno = 10054
Assumptions:Since  10054 = "Connection reset by peer", I assume the
origin of both messages is occurring on the server, and they are both
reporting same condition.
Question:If my assumption is correct, is there something I need to do
with Firebird that will prevent/minimize this?  I'm leaving town for the
weekend, will not have time to look at the server until Monday. I plan
to look at Firewall and FileZilla settings, Should I check anything
else?
More background:I have a server application (also written in Delphi
using Indy) running on the same server in the same domain. It has been
running flawlessly for many months. This same machine, router and switch
has been my web server for over a year.





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



[firebird-support] OIT / NT

2012-03-30 Thread Tiberiu Horvath
Hi all, 


I have a customer who uses my accounting system, who has a server (FB 2.5.1) 
and 4 clients, distibuted and connected via Internet to this server. People 
there complains about poor performance. I use Firebird Transaction Statistic 
Logger to see the problem. One and only one of the clients (figured out which) 
somehow foods my server. While this client is using my software, somehow the 
gap between OIT and NT increases 200 transactions each 5 seconds. I backup 
their data each night, and after this I start a gfix.exe -sweep that makes 
things ok. 

the server log (Linux) says a few " INET/inet_error: read errno = 104" 
problems, but just a few each day. 


Have anybody encountered something like this ? Is this a hardware or a software 
problem ? 



Thank you, 

Tiberiu 


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



Re: [firebird-support] OIT / NT

2012-03-30 Thread Thomas Steinmaurer
> I have a customer who uses my accounting system, who has a server (FB 2.5.1) 
> and 4 clients, distibuted and connected via Internet to this server.

The Firebird remote protocol isn't really optimized for WAN usage.


> People there complains about poor performance. I use Firebird Transaction 
> Statistic Logger to see the problem. One and only one of the clients (figured 
> out which) somehow foods my server. While this client is using my software, 
> somehow the gap between OIT and NT increases 200 transactions each 5 seconds. 
> I backup their data each night, and after this I start a gfix.exe -sweep that 
> makes things ok.

Is the OAT stuck as well? If yes, then you have a long-running active 
transaction. Use the monitoring tables to identify the offending 
transaction.

> the server log (Linux) says a few " INET/inet_error: read errno = 104" 
> problems, but just a few each day.
>
>
> Have anybody encountered something like this ? Is this a hardware or a 
> software problem ?

Usually bad transaction management in the client application. If OAT 
moves forward and it's only OIT which got stuck, this can happen with a 
write-able transaction which rolled back a huge data manipulation 
operation. What's your Sweep Interval setting?

If you are using distributed transactions across two or more databases, 
then a failed 2PC transaction will stuck the transaction counters (at 
least OIT) as well. But as the sweep cures the problem, I think this 
isn't the problem in your case.


-- 
With regards,
Thomas Steinmaurer (^TS^)
Firebird Technology Evangelist

http://www.upscene.com/

Do you care about the future of Firebird? Join the Firebird Foundation:
http://www.firebirdsql.org/en/firebird-foundation/


Re: [firebird-support] Re: Firebird and sharding ? - Email found in subject

2012-03-30 Thread Lester Caine
nathanelrick wrote:
>> I think you also mentioned that Ebay doesn't allow joins and uses the
>> >  application to do the joining. If that's the case, I'm glad I don't work
>> >  for Ebay. I'll be willing to bet that the Ebay application is written in
>> >  Java - that sounds like the sort of thing that the Java developers (and
>> >  vendors) I come into contact always do, treat the database as a bit
>> >  bucket and reinvent the wheel - caching results, joins, referential
>> >  integrity, check constraints etc.
> http://www.addsimplicity.com/downloads/eBaySDForum2006-11-29.pdf
>
> No business logic in database
> no stored procedure
> only very  simple triggers (default population)
>
> Move CPU  intensive work to applications
> Referential integrity
> joins
> sorting
>
> Extensive use of prepared statements and variables
>
> and yes you are right they move their C++/ISAPI to JAVA:)  by the way that a 
> curious choice ...

Not as curious as switching to IIS in 1999? That is probably a good explanation 
on why they ended up having to move to Java. Where would their system be today 
if they had simply stuck with unix/linux based system :) Although I believe 
their search side is still unix based?

-- 
Lester Caine - G8HFL
-
Contact - http://lsces.co.uk/wiki/?page=contact
L.S.Caine Electronic Services - http://lsces.co.uk
EnquirySolve - http://enquirysolve.com/
Model Engineers Digital Workshop - http://medw.co.uk//
Firebird - http://www.firebirdsql.org/index.php


Re: [firebird-support] Re: Firebird and sharding ? - Email found in subject

2012-03-30 Thread Norman Dunbar
On 30/03/12 07:40, nathanelrick wrote:
> http://www.addsimplicity.com/downloads/eBaySDForum2006-11-29.pdf
Because I'm a masochist, I'll have a read of that later!

> No business logic in database
> no stored procedure
> only very  simple triggers (default population)
>
> Move CPU  intensive work to applications
> Referential integrity
> joins
> sorting
They are certainly keeping the database simple then. Wonder why they 
bothered to pay huge sums of money to Oracle for licenses and features 
to make their lives simple, and then completely ignore them and do 
everything in code, in the application.

Sounds like their head of development needs a good (metaphorical) kicking.

This database will be corrupted at some point as soon as someone runs a 
script that manages to avoid all the check constraints, referential 
integrity and so on, unless they have to build it into each and every 
script that touches the database.

Madness. Complete madness. A prime example on how not to create a 
database system!


> Extensive use of prepared statements and variables
Yes, and I'll bet they do what every Java application I've seen does, 
prepares the same statement hundreds of times, even though they should 
do it only once.

See 
http://qdosmsq.dunbar-it.co.uk/blog/2009/02/it-must-be-efficient-im-using-bind-variables/
 
for details. :-)


Cheers,
Norm.

-- 
Norman Dunbar
Dunbar IT Consultants Ltd

Registered address:
Thorpe House
61 Richardshaw Lane
Pudsey
West Yorkshire
United Kingdom
LS28 7EL

Company Number: 05132767


[firebird-support] SP problem execute statement

2012-03-30 Thread Jack Mills
Hi

firebird 2.5 on windows XP

I have a SP that compiles ok & debugs ok using IBExpert but when I try to run 
the sp I get error 'Output parameters mismatch'

Here the relevant statements.
select c.Test_ID_New, c.ta_check from ptst p
left outer join tst_cfgd c on p.test_code = c.Test_Code and p.m1 =c.m1 and 
p.m2 = c.m2 and p.m3 = c.m3
where p.uop_no = :uop and p.state_no = :state and p.test_no = :test
into :id, :sel_query;

sel_query = replace (sel_query, 'where p.uop_no =','where p.uop_no = '||:uop||' 
and p.state_no = '||:state||' and p.test_no = '||:test||'');

execute statement sel_query into 
:ta1,:ta2,:ta3,:ta4,:ta5,:ta6,:ta7,:ta8,:ta9,:ta10,:ta11,:ta12,:ta13,:ta14,:ta15,:ta16,:ta17,:ta18,:ta19,:ta20,:ta21,:ta22,:ta23,:ta24,:ta25,:ta26;

The reported problem line is
execute statement sel_query into :ta1 etc.

ta1 through ta26 are declared as local varchar variables.

Typical contents of sel_query
select distinct p.tag1, p.oper, p.tag2, p.tag3,
case when (p.tag1 = a1.tag_no) then 'ok' else 'bad' end as at1,
case when (p.oper = o.code) then 'ok' else 'bad' end as op,
case when (p.tag2 = a2.tag_no) then 'ok' else 'bad' end as at2,
case when (p.tag3 = a3.tag_no) then 'ok' else 'bad' end as at3,
'nu' as at9,'nu' as at10,'nu' as at11,'nu' as at12,'nu' as at13,'nu' as 
at14,'nu' as at15,'nu' as at16,'nu' as at17,'nu' as at18,'nu' as at19,'nu' as 
at20,'nu' as at21, 'nu' as at22,'nu' as at23,'nu' as at24, 'nu' as at25, 'nu' 
as at26
from ptst p 
left outer join analog a1 on p.tag1 = a1.tag_no 
left outer join opers o on p.oper = o.code 
left outer join analog a2 on p.tag2 = a2.tag_no 
left outer join analog a3 on p.tag3 = a3.tag_no  
where p.uop_no =

I tried changing at1~at26 to output parameters but that changed the problem 
line to the one following the execute statement into etc., but I don't think 
there is a problem with the line. 

During debugging with IBExpert all the selected sel_query are correct & all the 
contents of at1~at26 appear correct.
Any help appreciated.
I can post the full sp if it would make thing clearer.

Jack





Re: [firebird-support] Re: Firebird and sharding ? - Email found in subject

2012-03-30 Thread Norman Dunbar
On 29/03/12 17:21, Ann Harrison wrote:
> When Norm says he isn't quite sure about something, I have to assume that
> lots of people are also in the dark.
I think you give me too much credit there! ;-)


> The performance problem in preparing
> queries comes from the algorithm Firebird uses to estimate the cardinality
> (number of records) of a table.


Good explanation, thanks. That's going to end up in the Firebird 
Internals manual sometime!

I've no idea how good a suggestion this is, but how difficult (sorry 
developers!) would it be to do something along the Oracle lines?

RDB$RELATIONS would have columns for cardinality, spread of values and 
so on. These would be recalculated on demand - Oracle used a package 
called DBMS_STATS to gather optimiser stats.

The optimiser in Oracle then reads these stats, and histograms etc form 
other system tables, and uses these to pick the best execution plan.

Granted the stats have to be kept "reasonably" up to date or performance 
suffers, but it's a good way of avoiding dynamic scans to check cardinality?

Just a thought.

Cheers,
Norm.

-- 
Norman Dunbar
Dunbar IT Consultants Ltd

Registered address:
Thorpe House
61 Richardshaw Lane
Pudsey
West Yorkshire
United Kingdom
LS28 7EL

Company Number: 05132767


Re: [firebird-support] Identifying damanged pages

2012-03-30 Thread Josef Kokeš
Dne 29.3.2012 18:26, Ann Harrison napsal(a):
> 2012/3/29 Josef Kokeš
>
>>
>> Due to hardware malfunction, my database got damaged. GFIX (-v -f -i)
>> tells me that a database has 1 "record level error", 9 "data page
>> errors", 41 "index page errors" and 322 "database page errors".
>>
>
> IBFirstAid is your friend, as is backup.  But before you backup the
> database, make a copy, use gfix to set it to read only, and back it
> up with gbak, using the -g switch to suppress garbage collection.
>
> If that works, you're unlikely to have lost data.  Backup walks each
> table in storage order.  The structures are linked, so a lost or damaged
> data page will show up.

Luckily, the damaged table was one which rarely changes, so I was able 
to restore it from backup with good results. But I am noting down this 
suggestion for future reference. THanks for the suggestion!

Josef




++

Visit http://www.firebirdsql.org and click the Resources item
on the main (top) menu.  Try Knowledgebase and FAQ links !

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

++
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:
http://docs.yahoo.com/info/terms/



Re: [firebird-support] OIT / NT

2012-03-30 Thread Ann Harrison
On Fri, Mar 30, 2012 at 4:13 AM, Tiberiu Horvath
wrote:

>
>  I use Firebird Transaction Statistic Logger to see the problem. ... While
> this client is using my software, somehow the gap between OIT and NT
> increases 200 transactions each 5 seconds.



OK, time for my lecture on OAT and  OIT.

The OIT is the oldest transaction in the system that did not commit -
usually a transaction that failed but could not roll itself back.  They're
more common in Classic that SuperServer because the latter rolls back
transactions after a normal failure.  But if one of the client processes is
killed, it will leave all its transactions marked as rolled back.  There
are only two ways to increase the OIT.  Backup/restore or sweep.  The good
news is that an old, stuck OIT doesn't matter much at all.  A very long
time ago when we could only dream of have a gig of disk (and not even
imaging a whole gig of memory), keeping a list of the states of old
transactions (at two bits per transaction) between the OIT and current
transaction was a problem.  It's not any more.

So don't worry about the difference between the OIT and next, or if you
must worry, run a sweep from time to time.

The OAT is the oldest transaction that the system considers to be active.
 It blocks garbage collection and induces database bloat.  Transactions
that commit using "commit retaining" do not advance the OAT.  Transactions
that are left open for hours  - even transactions  that have not changed
the database - leave the OAT stuck.  Once the OAT is stuck, Firebird must
keep old versions of records that transaction might read if it ever wakes
up and starts working again.

Do worry about a stuck OAT.  Use the MON$ tables to identify it and stop it.

Good luck,

Ann


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



Re: [firebird-support] Re: Firebird and sharding ? - Email found in subject

2012-03-30 Thread Ann Harrison
Norm,


> I've no idea how good a suggestion this is, but how difficult (sorry
> developers!) would it be to do something along the Oracle lines?
>
> RDB$RELATIONS would have columns for cardinality, spread of values and
> so on. These would be recalculated on demand - Oracle used a package
> called DBMS_STATS to gather optimiser stats.
>
> The optimiser in Oracle then reads these stats, and histograms etc form
> other system tables, and uses these to pick the best execution plan.
>
> Granted the stats have to be kept "reasonably" up to date or performance
> suffers, but it's a good way of avoiding dynamic scans to check
> cardinality?
>


That way, if the stats are wrong it's the database administrator's fault
that
the performance is bad.  Knowing how to fix that bad performance makes
the DBA more magical, raising his value.

I really prefer self-tuning, self-managing statistics.  We don't have them
for
indexes, but as I said, index selectivity is not normally as volatile as
cardinality.

There's problem with keeping data ranges (or histograms), given that
Firebird prepares a statement before it knows the values of parameters.

select first_name, last_name from rugby_players where gender  = ?

Assuming an index on gender, you'd handle the query one way if the
? = M vs. F

And if it happens during a nested loop join?  Re-optimize on every record?

Good luck (and we all need it)

Ann


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