Function Main( cPath )
Local i, aStru
Field NAME, NUM, INFO, DINFO
REQUEST LETO
RDDSETDEFAULT( "LETO" )
SET DATE FORMAT "dd/mm/yy"
IF Empty( cPath )
cPath := "//127.0.0.1:2812/temp/"
ELSE
cPath := "//" + cPath + Iif( Right(cPath,1) $ "/\", "", "/" )
ENDIF
Leto_fErase( cPath+"test1" )
dbCreate( cPath+"test1", { {"CODIGO","N",5,0}, {"DESCRI","C",10,0} } )
? "File has been created"
USE ( cPath+"test1" ) New
? "File has been opened"
INDEX ON CODIGO TAG CHAVE
? "File has been indexed"
leto_BeginTransaction()
APPEND BLANK
REPLACE CODIGO WITH 1
REPLACE DESCRI WITH "TESTEEEE"
? "Records has been added"
DbGoTop()
? DbSeek( 1 ) // Here bug, not found the record that was just inserted
leto_CommitTransaction()
DbGoTop()
? DbSeek( 1 ) // now found after the commit
?
? "Press any key to finish..."
Inkey(0)
Return Nil
Works fine with DBFCDX and LETO without transaction.
Best regards,
Itamar M. Lins Jr.
This isn't a bug, this is a feature, this is the way as transactions works.
When you process a transaction, all operations, which updates the database, are buffered on the client side and are sent to the server for execution while leto_CommitTransaction().
So, before the leto_CommitTransaction() is complete, the database on the server isn't updated and the records are not added.
Last edit: Alexander S.Kresin 2015-06-17