Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Buffering / Record Locking
Message
De
27/08/2002 14:46:26
 
 
À
27/08/2002 14:01:59
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00694149
Message ID:
00694179
Vues:
8
I do not see where the 'llRollBack' variable is being set. I'd think that optomistic table buffering should pretty much be used in all buffering scenarios
[CursorSetProp('buffering',5)].

For more info on buffering see Jim Booth's articles on his web site:

http://www.jamesbooth.com/buffering_part_i.htm


>Hi, group, I'm here again.
>
>I'm having some trouble with record locking, and I'm trying to find out what is the right buffering mode I have to use.
>
>There's a table which stores info about the Products reserve and a table which stores the movement for that products.
>
>Whenever there's movement in the reserve, the system launches the movement and the new Reserve for that product in the Movement table, and the new Reserve for the product in the products reserve, all this in a Transaction.
>
>And here comes the trouble: the inserts are normally long, and if one of the stations in the network loses the connection (like the computer is Reset) the recors keep locked, making it impossible for another user to update that record. Here's the code:
>
>
>lcCod  = [000001] && could be any other code, this is a test code.
>lBuff  = CURSORSETPROP("Buffering",2,[g2_estoq])
>lBuff2 = CURSORSETPROP("Buffering",2,[g2_estmo])
>
>BEGIN TRANSACTION
>	UPDATE gereswin!g2_estoq SET qtd_est = CalcEstoque(qtd_est,lnValor,@lnSaldo) WHERE codigo=lcCod
>	lUp   = TABLEUPDATE(.t.,.t.,[g2_estoq])
> 	INSERT INTO g2_estmo (codigo,qtd_lanca,qtd_saldo,historico) VALUES(lcCod,lnValor,lnSaldo,[Pablo])
>	lUp2  = TABLEUPDATE(.t.,.t.,[g2_estmo])
>	
>IF llRollback
>        = MESSAGEBOX([Record locked by another user],64,[Warning])
>	ROLLBACK
>	= TABLEREVERT(.t.,[g2_estoq])
>	= TABLEREVERT(.t.,[g2_estmo])
>ELSE
>	IF lUp AND lUp2
>		END TRANSACTION
>	ELSE
>		ROLLBACK
>   		= TABLEREVERT(.t.,[g2_estoq])
>   		= TABLEREVERT(.t.,[g2_estmo])
>	ENDIF
>ENDIF
>FLUSH
>
>
>TIA,
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform