Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
BUG: with pess. buffering CURVAL() can to be mistaken
Message
De
16/12/2004 19:22:11
 
 
À
16/12/2004 18:42:43
Information générale
Forum:
Visual FoxPro
Catégorie:
Visual FoxPro Beta
Divers
Thread ID:
00969502
Message ID:
00969900
Vues:
10
>Hi Fabio,
>
>Haven't we discussed this already on the thread #968242?
>For pessimistic buffering OLDVAL() and CURVAL() return the same value and, in this scenario, OLDVAL() happens to be cached. Simple GO RECNO() refreshes data.
>
>Thanks,
>Aleksey.

Hi Aleksey,

1. OLDVAL() completely is understood now,
it is correlated with the parameter lforce of the TABLEUPDATE() function.

2. Sorry, i have post a bad repro version code.

This is the correct code:
CLEAR
SET MULTILOCKS ON

CREATE CURSOR myCursor ( F1 I) && exclusive mode
APPEND BLANK
CURSORSETPROP("Buffering",4)
replace f1 WITH 100             && ====== this is the variation
SELECT myCursor

? "FIELD ON ",ALIAS()," IS ",F1,CURVAL("F1")," STATUS :  ",GETFLDSTATE(-1)

? '******'
    USE DBF() IN 0 AGAIN ALIAS CLONE_CURSOR
    SELECT CLONE_CURSOR
    CURSORSETPROP("Buffering",1)
    ? "FIELD ON ",ALIAS()," IS ",F1

    REPLACE F1 WITH F1+1
    ? "FIELD ON ",ALIAS()," IS ",F1     &&,GETFLDSTATE(-1)
     ? "UPDATE IT IS OK ?"	&&,TABLEUPDATE()
    ? "FIELD ON ",ALIAS()," IS ",F1 ," <<<<< attention here"   &&,CURVAL("F1"),GETFLDSTATE(-1)
    USE
? '******'
SELECT myCursor
 * next line show a bad CURVAL()
 * cause it is because with pessimistic locking, VFP member guess that CURVAL() cannot change,
 * but it is not true, it can change within the same session !

 * for sync CURVAL() you can do 2 thing only: TABLEUPDATE() or TABLEREVERT()
? "FIELD ON ",ALIAS()," IS ",F1,CURVAL("F1")," <<<<< attention here" , GETFLDSTATE(-1)
GO RECNO()  && put GO RECNO()
? "now CURVAL() it is not refreshed, and i cannot found a way for refresh it"
? "FIELD ON ",ALIAS()," IS ",F1,CURVAL("F1")," <<<<< attention here" , GETFLDSTATE(-1)
USE
3. Why cannot VFP redefine internal code for CURVAL() and then:
- read data from cache buffers directly and support buffering 1.
With this i can skip to use GO RECNO().

Thanks
Fabio
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform