Board index » delphi » Help! Unknown Win32 error 10054

Help! Unknown Win32 error 10054


2006-11-22 08:18:00 AM
delphi253
I have a long established system using IB5.6 with some D5 apps.
The apps have started generating:
General SQL Error.
Unable to complete network request to host "serverak".
Error writing data to the connection.
unknown Win32 error 10054.
The IB log repeatedly reports:
MORIARTY (Client) Wed Nov 22 12:58:25 2006
D:\Interbase\bin\ibserver.exe: terminated abnormally (-1)
MORIARTY (Client) Wed Nov 22 12:58:25 2006
Guardian starting: D:\Interbase\bin\ibserver.exe
I can fairly reliably reproduce the error by running a certain parameterised
query passing 2 dates to a stored procedure:
select *
from GetDataEntryFlags(:FirstOfMonth, :LastOfMonth)
After running this and raising the exception, other queries which previously
worked now raise the same error.... The system is practically unusable.
Can anyone give me some hints as to what to be looking for? Thanks.
--
Brent Rose
Whats On Report
XXXX@XXXXX.COM
 
 

Re:Help! Unknown Win32 error 10054

"Brent Rose" <XXXX@XXXXX.COM>writes
Quote
I have a long established system using IB5.6 with some D5 apps.

I can fairly reliably reproduce the error by running a certain
parameterised query passing 2 dates to a stored procedure:

select *
from GetDataEntryFlags(:FirstOfMonth, :LastOfMonth)
First of all, IB 5.6 is getting pretty old, so you may have few options
here. Would it be possible for you to post the code for the SP in question?
Dan
 

Re:Help! Unknown Win32 error 10054

Brent Rose writes:
Quote
I have now deduced that many of the issues arising with other users
were probably due to termination of the IB server following this
error.
That seems likely since 10054 is a Winsock error with the message, "An
existing connection was forcibly closed by the remote host." I suspect
the server crash is what is forcibly closing the TCP/IP connection.
--
Bill Todd (TeamB)
 

Re:Help! Unknown Win32 error 10054

(Yes IB5.6 is somewhat long in the tooth, but it still works very well for
us - upgrading is definitely going to happen, but not just yet!)
Stored/proc code is below. Interestingly, the parameters for it were passed
to a TQuery using:
ParamByName('FirstOfMonth').AsDate := FCurrentMonth;
When I changed this to:
ParamByName('FirstOfMonth').AsString := FormatDateTime('d mmm yyyy',
FCurrentMonth);
the problem disappeared for this particular instance.
I have now deduced that many of the issues arising with other users were
probably due to termination of the IB server following this error. I have
only identified one PC (which has had a lot of new software dumped on it)
that definitely has this date issue, but cannot see why this should be the
case (it has worked OK for a long time - but something has obviously
changed).
This old D5 app using TDatabase & TQuery etc is using the BDE as
middleware...
ALTER PROCEDURE WORARCHIVEUC (
ARCHIVEDATE DATE,
COUNTONLY SMALLINT)
RETURNS(
ARCHIVECOUNT INTEGER)
AS
declare Variable JobID Integer;
declare Variable HoldMonths SmallInt;
declare Variable AgedPublishDate Date;
declare Variable Archive SmallInt;
begin
/* count and optionally archive (if CountOnly = 0) UC jobs */
ArchiveCount = 0;
for
select FDJID, PublishDate, HoldUCMonths
from FDJob
where (JobSectionID = 4)
into :JobID, :AgedPublishDate, :HoldMonths
do
begin
/* default is 12 mths if no hold period specified */
if (HoldMonths = 0) then
HoldMonths = 12;
AgedPublishDate = F_AddMonth(AgedPublishDate, HoldMonths);
/* check if OK to archive job */
Archive = 0;
if (AgedPublishDate < ArchiveDate) then
begin
ArchiveCount = (ArchiveCount + 1);
if (CountOnly = 0) then
update FDJob
set JobSectionID = 9
where FDJID = :JobID;
end
end
end
--
Brent Rose
Whats On Report
XXXX@XXXXX.COM
 

Re:Help! Unknown Win32 error 10054

Oops - that was entirely the wrong s/proc!!
This is it - it actually does very little!
ALTER PROCEDURE "GETDATAENTRYFLAGS" (
"FIRSTOFMONTH" DATE,
"LASTOFMONTH" DATE)
RETURNS(
"AREAID" INTEGER,
"ENTRYMONTH" DATE,
"DATEUPDATED" DATE,
"ENTRYSTATUSID" INTEGER,
"ENTRYSTATUSTEXT" CHAR(15),
"LOCALAUTHORITYNAME" VARCHAR(40))
AS
begin
for
select
f.AreaID, f.EntryMonth, f.DateUpdated, f.EntryStatusID,
s.EntryStatusText,
a.AreaName
from DataEntryFlag f
join DataEntryStatus s on f.EntryStatusID = s.EntryStatusID
join AreaConsent c on f.AreaID = c.AreaID
join Area a on c.AreaID = a.AreaID
where f.EntryMonth between :FirstOfMonth and :LastOfMonth
order by a.AreaName
into
:AreaID, :EntryMonth, :DateUpdated, :EntryStatusID,
:EntryStatusText,
:LocalAuthorityName
do
suspend;
end
--
Brent Rose
XXXX@XXXXX.COM
"Dan Palley" <XXXX@XXXXX.COM>writes
Quote
"Brent Rose" <XXXX@XXXXX.COM>writes
news:45639585$XXXX@XXXXX.COM...
 

Re:Help! Unknown Win32 error 10054

Quote
ALTER PROCEDURE "GETDATAENTRYFLAGS" (
"FIRSTOFMONTH" DATE,
"LASTOFMONTH" DATE)
RETURNS(
"AREAID" INTEGER,
"ENTRYMONTH" DATE,
"DATEUPDATED" DATE,
"ENTRYSTATUSID" INTEGER,
"ENTRYSTATUSTEXT" CHAR(15),
"LOCALAUTHORITYNAME" VARCHAR(40))
AS
begin
for
select
f.AreaID, f.EntryMonth, f.DateUpdated, f.EntryStatusID,
s.EntryStatusText,
a.AreaName
from DataEntryFlag f
join DataEntryStatus s on f.EntryStatusID = s.EntryStatusID
join AreaConsent c on f.AreaID = c.AreaID
join Area a on c.AreaID = a.AreaID
where f.EntryMonth between :FirstOfMonth and :LastOfMonth
order by a.AreaName
into
:AreaID, :EntryMonth, :DateUpdated, :EntryStatusID,
:EntryStatusText,
:LocalAuthorityName
do
suspend;
end
Just for test purposes. What happens if you execute the SELECT statement
without running it in a stored procedure?
--
Best Regards,
Thomas Steinmaurer
LogManager Series - Logging/Auditing Suites supporting
InterBase, Firebird, Advantage Database, MS SQL Server and
NexusDB V2
Upscene Productions
www.upscene.com
 

Re:Help! Unknown Win32 error 10054

Will have to wait for some down-time to try this - cannot be killing the
server on everyone if it fails! I'd imagine it will work OK.
I had discovered that by using string literals for the dates rather than
ParamByName() with the s/proc, that it worked fine. Hence as before, the
issue would appear to be related to passing ParamByName().AsDate. Cannot see
anything wrong with date formats on PC or in BDE.
However, bear in mind that this same app has worked in its original state
for something like a decade - so still looking for something local on the
guilty work station!
--
Brent Rose
Whats On Report
XXXX@XXXXX.COM
 

Re:Help! Unknown Win32 error 10054

Brent Rose writes:
Quote
ParamByName('FirstOfMonth').AsDate := FCurrentMonth;

When I changed this to:

ParamByName('FirstOfMonth').AsString := FormatDateTime('d mmm yyyy',
FCurrentMonth);

the problem disappeared for this particular instance.
There is a bug in BDE 5.2 concerning Date params. Try replacing
sqlint32.dll from 5.2 with the 5.1(1) version and see if the problem
also goes away.
--
Craig Stuntz [TeamB] ?Vertex Systems Corp. ?Columbus, OH
Delphi/InterBase Weblog : blogs.teamb.com/craigstuntz
All the great TeamB service you've come to expect plus (New!)
Irish Tin Whistle tips: learningtowhistle.blogspot.com
 

Re:Help! Unknown Win32 error 10054

"Craig Stuntz [TeamB]" <XXXX@XXXXX.COM [a.k.a. acm.org]>wrote
in message news:456b0303$XXXX@XXXXX.COM...
Quote
Brent Rose writes:

>ParamByName('FirstOfMonth').AsDate := FCurrentMonth;
>
>When I changed this to:
>
>ParamByName('FirstOfMonth').AsString := FormatDateTime('d mmm yyyy',
>FCurrentMonth);
>
>the problem disappeared for this particular instance.

There is a bug in BDE 5.2 concerning Date params. Try replacing
sqlint32.dll from 5.2 with the 5.1(1) version and see if the problem
also goes away.
After moving from 5.1 to 5.2 we use "ParamByName('FirstOfMonth').AsDateTime"
--
Todor Geshev
 

Re:Help! Unknown Win32 error 10054

Thanks. BDE version explains everything nicely (some pretty old software is
in use - PC in question ended up with 5.2).
Best solution is, of course, to migrate away from the dear old BDE!
--
Brent Rose
Whats On Report
XXXX@XXXXX.COM