Different time CDX after COMMIT,DBCOMMIT

This forum is for eXpress++ general support.
Post Reply
Message
Author
Victorio
Posts: 633
Joined: Sun Jan 18, 2015 11:43 am
Location: Slovakia

Different time CDX after COMMIT,DBCOMMIT

#1 Post by Victorio »

Hi,

Who know, why after commit is updated only date time of DBF file, but no CDX ?

I need to control consistency both files to test, if somebody not open and modify database without CDX file (Visual Foxpro).
I am testing when date "detuning" and now I see after commit, or dbcommit, or dbcommitall.

Exist some solution to update both files, or I can not use command COMMIT ? Or I have bad settings in dbesys ?

Here is my settings in DBESYS:

STATIC FUNCTION Dbesys()

LOCAL i, aDbeList := DbeList(), cDbeList := ''

SET COLLATION TO ASCII

IF Valtype(aDbeList) = 'A'
FOR i := 1 TO Len(aDbeList)
cDbeList += aDbeList[i,1] + ','
NEXT
ENDIF

aDbeList := cDbeList

IF !('DBFDBE'$aDbeList) .AND. !DbeLoad( "DBFDBE",.T.)
DC_WinAlert( "Database-Engine DBFDBE not loaded" )
ENDIF
IF !('NTXDBE'$aDbeList) .AND. !DbeLoad( "NTXDBE",.T.)
DC_WinAlert( "Database-Engine NTXDBE not loaded" )
ENDIF
IF !('DBFNTX'$aDbeList) .AND. !DbeBuild( "DBFNTX", "DBFDBE", "NTXDBE" )
DC_WinAlert( "DBFNTX Database-Engine, Could not build engine" )
ENDIF
IF !('CDXDBE'$aDbeList) .AND. !DbeLoad( "CDXDBE",.T.)
DC_WinAlert( "Database-Engine CDXDBE not loaded" )
ENDIF
IF !('DBFCDX'$aDbeList) .AND. !DbeBuild( "DBFCDX", "DBFDBE", "CDXDBE" )
DC_WinAlert( "DBFCDX Database-Engine, Could not build engine" )
ENDIF
IF !('FOXDBE'$aDbeList) .AND. !DbeLoad( "FOXDBE",.T.)
DC_WinAlert( "Database-Engine FOXDBE not loaded" )
ENDIF
IF !('FOXCDX'$aDbeList) .AND. !DbeBuild( "FOXCDX", "FOXDBE", "CDXDBE" )
DC_WinAlert( "FOXCDX Database-Engine, Could not build engine" )
ENDIF
IF !('DELDBE'$aDbeList) .AND. !DbeLoad( "DELDBE",.T.)
DC_WinAlert( "Database-Engine DELDBE not loaded" )
ENDIF

DbeSetDefault( "FOXCDX" ) // toto bolo
DbeInfo(COMPONENT_DATA, FOXDBE_LIFETIME, 20 ) && bielik

RETURN .t.

skiman
Posts: 1199
Joined: Thu Jan 28, 2010 1:22 am
Location: Sijsele, Belgium
Contact:

Re: Different time CDX after COMMIT,DBCOMMIT

#2 Post by skiman »

Hi,

I don't think you will ever succeed to have a 100% control with this.

Suppose the following:
User1 opens de DBF and changes something. The CDX is not updated and has a different time.
User2 opens the DBF AND CDX one second later. After a change both DBF and CDX have the same time. However the CDX isn't consistent! When you check at this moment, you can't see that there is something wrong because of user 1.

If you want to use it this way, I would add an extra index tag with the time().
index on time() into....

I would expect that this will change the CDX every time there is a change in the DBF, even if no indexed field is changed. But the above situation will still remain.
Best regards,

Chris.
www.aboservice.be

Victorio
Posts: 633
Joined: Sun Jan 18, 2015 11:43 am
Location: Slovakia

Re: Different time CDX after COMMIT,DBCOMMIT

#3 Post by Victorio »

Hm, isn't simple...

So I would expect that after change in DBF always change CDX, but this changed only when close table. Here solution can be always after append or some modify record remember position record and also active order then and close and open again table and go to last position.
Or disable commit, I do not know at this moment, if can be some problems if not use commit in network .

At this moment I thing about, how can system change time when other usersc have opened table. This must have some locking system. And CDX need also some locking.

thanks for advice.

Post Reply