2155 error hb_cdxindexCheckVersion fivewin/harbour

2155 error hb_cdxindexCheckVersion fivewin/harbour

Postby lorenzoazz » Mon Jun 29, 2015 9:38 am

I have a program compiled with 32bit bcc ( harbour and fivewin libs)
This error occurs only in windows 8.1 (not on XP) after the "suspension"
on windows 8.1 and also in XP compatible mode.

It happens ONLY at the moment the program try to seek on an index ( probably a "static" index that get lost after suspension mode)


The error is unrecovarable in any way i knew, and any update to the database, get lost.

Hoping to get some suggestion from you!

Thanks
Lorenzo
lorenzoazz
 
Posts: 37
Joined: Mon Jun 29, 2015 7:41 am

Re: 2155 error hb_cdxindexCheckVersion fivewin/harbour

Postby cnavarro » Mon Jun 29, 2015 9:48 am

Try to use after recording a modified or new data DBCOMMIT ()
Cristobal Navarro
Hay dos tipos de personas: las que te hacen perder el tiempo y las que te hacen perder la noción del tiempo
El secreto de la felicidad no está en hacer lo que te gusta, sino en que te guste lo que haces
User avatar
cnavarro
 
Posts: 6500
Joined: Wed Feb 15, 2012 8:25 pm
Location: España

Re: 2155 error hb_cdxindexCheckVersion fivewin/harbour

Postby lorenzoazz » Mon Jun 29, 2015 11:31 am

Thanks for the reply.

Consider that, the problem rises when hardware goes in suspension mode, so it happens when in stand-by,
while you take a coffee break.
I mean, if the hardware do not go in stand-by (as a notebook does) , there is no error when i go to recording!
I cannot PREVENT the stand-by event, so i cannot dbcommit() before replace()...
lorenzoazz
 
Posts: 37
Joined: Mon Jun 29, 2015 7:41 am

Re: 2155 error hb_cdxindexCheckVersion fivewin/harbour

Postby cnavarro » Mon Jun 29, 2015 11:33 am

lorenzoazz wrote:Thanks for the reply.

Consider that, the problem rises when hardware goes in suspension mode, so it happens when in stand-by,
while you take a coffee break.
I mean, if the hardware do not go in stand-by (as a notebook does) , there is no error when i go to recording!
I cannot PREVENT the stand-by event, so i cannot dbcommit() before replace()...


My English is very poor
DBCOMMIT, DBCOMMITALL, is to be performed at the end of the append or replace

Or it is when you leave the record unfinished?

You can not have this option selected on your network card
Image
Cristobal Navarro
Hay dos tipos de personas: las que te hacen perder el tiempo y las que te hacen perder la noción del tiempo
El secreto de la felicidad no está en hacer lo que te gusta, sino en que te guste lo que haces
User avatar
cnavarro
 
Posts: 6500
Joined: Wed Feb 15, 2012 8:25 pm
Location: España

Re: 2155 error hb_cdxindexCheckVersion fivewin/harbour

Postby lorenzoazz » Mon Jun 29, 2015 12:09 pm

Yes, it happens only when i leave the record unfinisced!
So when i resume from suspension mode, i try to update the record and i git the unrecoverable error!
lorenzoazz
 
Posts: 37
Joined: Mon Jun 29, 2015 7:41 am

Re: 2155 error hb_cdxindexCheckVersion fivewin/harbour

Postby lorenzoazz » Mon Jun 29, 2015 6:41 pm

Please, no one has encountered this error?

I think it is a general index error depending on system suspension.

I have also read ( do not remeber where) that someone had adopted a trick
inserting at program initialization a "Request"

REQUEST DESCEND

but not working for me.
lorenzoazz
 
Posts: 37
Joined: Mon Jun 29, 2015 7:41 am

Re: 2155 error hb_cdxindexCheckVersion fivewin/harbour

Postby karinha » Mon Jun 29, 2015 6:50 pm

João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
User avatar
karinha
 
Posts: 7214
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil

Re: 2155 error hb_cdxindexCheckVersion fivewin/harbour

Postby karinha » Mon Jun 29, 2015 6:59 pm

Corruption detected?

Look

dbOrderInfo

http://sourceforge.net/p/xharbour/mailman/message/16232978/

Regards.
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
User avatar
karinha
 
Posts: 7214
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil

Re: 2155 error hb_cdxindexCheckVersion fivewin/harbour

Postby Antonio Linares » Mon Jun 29, 2015 7:01 pm

Lorenzo,

Maybe you can first check if a file exists to force the wake up of the computer:

Code: Select all  Expand view

while ! File( "myfile.txt" )
   SysRefresh()
end
 
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 41314
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: 2155 error hb_cdxindexCheckVersion fivewin/harbour

Postby karinha » Mon Jun 29, 2015 7:04 pm

2155 Read error on index heading page

Explanation: A read error occurred when reading the heading page of
the index file, or the header did not contain the .ntx/cdx signature, or the
macro compiler returned a syntax error when attempting to compile the
key expression.

Action: Recreate the index file and check the key expression. Make
sure the database header is updated before index recreation.
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
User avatar
karinha
 
Posts: 7214
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil

Re: 2155 error hb_cdxindexCheckVersion fivewin/harbour

Postby lorenzoazz » Tue Jun 30, 2015 8:02 am

Antonio Linares wrote:Lorenzo,

Maybe you can first check if a file exists to force the wake up of the computer:

Code: Select all  Expand view

while ! File( "myfile.txt" )
   SysRefresh()
end
 


Antonio,
thanks but this does not work!
It is not a problem of file not found or read error, the problem is coming from the fact that, when in suspension
the "static" ? reference to the index file is lost.
I got the same error even if i try to relink the index!

This is not a question about some wrong code logic of mine, is all about the way windows 8.1 manage
and restore the memory after suspension !!!

This error OCCURS ONLY in this occasion/situation !

and here the Harbour code that cause the ERROR 2155

Code: Select all  Expand view
/*
 * check if index was updated by other process and if it was discard buffers
 */

static void hb_cdxIndexCheckVersion( LPCDXINDEX pIndex )
{
   BYTE byBuf[8];
   ULONG ulVer, ulFree;

   if ( hb_fsSeek( pIndex->hFile, 0x04, FS_SET ) != 0x04 ||
       hb_fsRead( pIndex->hFile, byBuf, 8 ) != 8 )
   {
      if ( pIndex->lockWrite > 0 && hb_fsSeek( pIndex->hFile, 0, FS_END ) == 0 )
         memset( byBuf, 0, 8 );
      else
         hb_errInternal( 2155, "hb_cdxIndexCheckVersion: Read error on index heading page.", NULL, NULL );
   }
lorenzoazz
 
Posts: 37
Joined: Mon Jun 29, 2015 7:41 am

Re: 2155 error hb_cdxindexCheckVersion fivewin/harbour

Postby lorenzoazz » Tue Jun 30, 2015 12:54 pm

karinha wrote:2155 Read error on index heading page

Explanation: A read error occurred when reading the heading page of
the index file, or the header did not contain the .ntx/cdx signature, or the
macro compiler returned a syntax error when attempting to compile the
key expression.

Action: Recreate the index file and check the key expression. Make
sure the database header is updated before index recreation.


This cannot not be a solution because i would have to reindex every time i update,
as the program may be in suspended mode at any moment!
lorenzoazz
 
Posts: 37
Joined: Mon Jun 29, 2015 7:41 am

Re: 2155 error hb_cdxindexCheckVersion fivewin/harbour

Postby karinha » Tue Jun 30, 2015 1:59 pm

in xHarbour, I do so... Please test.

Code: Select all  Expand view

#Include "FiveWin.Ch"
#Include "Directry.ch"
#Include "Ord.Ch"

FUNCTION INDEX()

  ... DIALOG AND BUTTONS, ETC

  ... ACTION... ReIndPack( oMeter1, oMeter2, oMeter3 )

RETURN NIL

FUNCTION ReIndPack( oMeter1, oMeter2, oMeter3 )

   LOCAL Del_Indice

   EXTERNAL DESCEND

   DEL_INDICE := DIRECTORY( "*.CDX" )

   FOR I = 1 TO LEN( Del_Indice )
      FERASE( DEL_INDICE[I][1] )
   NEXT I

   IF NetUse( "CONVENIO", .F. )

       oMeter1:nTotal = RecCount()

       INDEX ON VAL(Field->CODIGO) TAG CODIGO TO CONVENIO                ;
             FOR !DELETED()                                              ;
             EVAL ( oMeter1:Set( RecNo() ), CursorWait(), SysRefresh() ) ;
             EVERY 10

       INDEX ON Field->NOME        TAG NOME   TO CONVENIO                ;
             FOR !DELETED()                                              ;
             EVAL ( oMeter1:Set( RecNo() ), CursorWait(), SysRefresh() ) ;
             EVERY 10

       DbCloseAll()

   ENDIF

RETURN NIL
 


Regards,
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
User avatar
karinha
 
Posts: 7214
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil

Re: 2155 error hb_cdxindexCheckVersion fivewin/harbour

Postby Carlos Mora » Tue Jun 30, 2015 2:15 pm

Hi lorenzoazz,

as CNavarro explained, if the OS is allowed to turn off network cards when going into suspend or energy saving mode, all files open are being closed, so there is NO WAY to recover from such situation. You SHOULD AVOID that, not allowing the card to be turned off by the operating system, as Cristobal Navarro explained. My operating system is in spanish, so i cannot show you an screenshot but look into network card properties, and DON'T ALLOW it to go off during energy saving.

In Antonio's post there is a line that shows you when the error arises, the system isn't able to read from the file, so the issue if far beyond your code, there is nothing to do from the Harbour's side, it seems to be a configuration problem.

Better yet, don't allow the computer go into suspend!
Saludos
Carlos Mora
http://harbouradvisor.blogspot.com/
StackOverflow http://stackoverflow.com/users/549761/carlos-mora
“If you think education is expensive, try ignorance"
Carlos Mora
 
Posts: 988
Joined: Thu Nov 24, 2005 3:01 pm
Location: Madrid, España

Re: 2155 error hb_cdxindexCheckVersion fivewin/harbour

Postby Antonio Linares » Tue Jun 30, 2015 3:34 pm

Lorenzo,

You may need to close the DBF and indexes and open them again, so the memory data is updated.
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 41314
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Next

Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 82 guests