Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
BUG :VFP's Transactions are only corrected with buffering=5
Message
From
10/12/2004 06:14:58
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Visual FoxPro Beta
Title:
BUG :VFP's Transactions are only corrected with buffering=5
Miscellaneous
Thread ID:
00968242
Message ID:
00968242
Views:
58
Previous issue Thread #967998

Bug/Issue : 28 of 49

TITLE: BUG : the Transactions of VFP are only corrected with "optimistic table buffering"

VERSION: 09.00.0000.1720 and previous

EXPECTED: unchanged data must reflect the tables data

OBSERVED:
- within a transaction, with the buffering pessimistic, CURVAL() it is mistaken
- with "optimistic table buffering" all it could be corrected

REPRO:
#DEFINE DBNAME SYS(2023)+'\DB______1'
#DEFINE TABLENAME SYS(2023)+'\TABLE______1'

* You changes the BUFFERINGMODE here
#DEFINE _BUFFERINGMODE  2

CLOSE ALL
CLEAR
ERASE FORCEEXT(DBNAME,'*')
ERASE FORCEEXT(TABLENAME ,'*')
* OPEN SESSION 1

S1=CREATEOBJECT("SESSION")
  SET DATASESSION TO S1.DATASESSIONID
  * build a DBC for do the test
  CREATE DATABASE DBNAME
  * a table
  CREATE TABLE TABLENAME ( F1 I)
  * a row
  APPEND BLANK
  * relase exclusive access
  CLOSE DATABASES
  SET MULTILOCKS ON
  * open share
  USE TABLENAME IN 100 ALIAS TABLE_ON_SESSION_1 SHARE
  =CURSORSETPROP("Buffering",_BUFFERINGMODE,100)
  ? [BUFFERING's table :],CURSORGETPROP("Buffering",100)
  ? "OPEN A FIRST TRANSACTION, BUT THIS DON'T DO ANYTHING"
  ? ALIAS(100),TABLE_ON_SESSION_1.F1,OLDVAL("F1",100),CURVAL("F1",100)
  BEGIN TRANSACTION
    ********************************************************
    * NOW SIMULATE ANOTHER SESSION, THIS WRITE ON THE TABLE NOW
    =anotherSession('transaction_X')
    ********************************************************
  SET DATASESSION TO S1.DATASESSIONID
  ?
  ? "MINOR BUG 1: THE SESSION 1 WORKAREA IS NOT TOUCHED, THEN"
  ? "EXPECTED 0|2 ,0|2 ,2 because field value on disk it is 2"
  ? ALIAS(100),TABLE_ON_SESSION_1.F1,OLDVAL("F1",100),CURVAL("F1",100)
  ? 
  ? "CLOSE THE FIRST TRANSACTION"
  END TRANSACTION
  ? "SERIOS BUG 2: I have not written into the record, IT'S STATUS IT IS :",GETFLDSTATE(-1,100)
  ? "THEN EXPECTED 2,2,2 because field value on disk it is 2"
  DO CASE
    CASE CURSORGETPROP("Buffering",100)=2
      ? "OBSERVED 0,0,0 !!!"
      ? "WORKAROUND : exec a TABLEREVERT() on all the tables with Row buffering"
    CASE CURSORGETPROP("Buffering",100)=3
      ? "OBSERVED 0,0,2 !!!"
      ? "WORKAROUND : exec a TABLEREVERT() on all the tables with Row buffering"
    CASE CURSORGETPROP("Buffering",100)=4
      ? "OBSERVED 2,2,2"
    CASE CURSORGETPROP("Buffering",100)=5
      ? "OBSERVED 2,2,2"
  ENDCASE
  ? ALIAS(100),TABLE_ON_SESSION_1.F1,OLDVAL("F1",100),CURVAL("F1",100)
  RELEASE S1
CLOSE ALL
ERASE FORCEEXT(TABLENAME ,'*')
ERASE FORCEEXT(DBNAME,'*')

PROCEDURE anotherSession(_alias)
  ?
  ? CHR(9),"SIMULATE ANOTHER TRANSACTION, THIS ADD 2 TO THE FIELD VALUE"
  WITH CREATEOBJECT("SESSION")
    SET DATASESSION TO .DATASESSIONID
    USE TABLENAME ALIAS (m._alias) SHARED
    BEGIN TRANSACTION
      REPLACE F1 WITH F1+2
    END TRANSACTION
    ? CHR(9),ALIAS(),F1
  ENDWITH
endproc
Next
Reply
Map
View

Click here to load this message in the networking platform