Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Discussão sobre Bufferização
Message
De
14/09/2005 13:10:43
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivie
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 9
OS:
Windows XP SP2
Network:
Windows XP
Database:
Visual FoxPro
Divers
Thread ID:
01049534
Message ID:
01049543
Vues:
10
This message has been marked as a message which has helped to the initial question of the thread.
>Olá pessoal,
>
>Cenário:
>VFP 9.0
>Sistema multiusuário
>
>No FPW 2.6a, eu sempre trabalhei com os comandos SCATTER e GATHER e só na hora de inserir/atualizar a tabela, eu bloqueava o registro ou a tabela.
>
>No VFP se usar a bufferização otimista, e tiver no banco a rotina de geração de código seqüencial (chave), na hora que der um APPEND BLANK a chave será gerada, possibilitando assim que dois usuários consigam inserir registros com a mesma chave.
>
>Sabendo que o TABLEUPDATE bloquei o registro ou a tabela, pergunto:
>
>- Devo travar a tabela toda manualmente no caso de inserir um novo registro, (antes do TABLEUPDATE para gerar o código)????????
>
>- Se sim, devo destravar a tabela manualmente após a TABLEUPDATE????????

Não; Visual FoxPro faze as travas requeridas automágicamente.

O que vocé sim deve fazer é verificar se o TableUpdate() tiver éxito, algo assim como:
if not TableUpdate()
  aerror(MeuErro)
  MessageBox("Erro gravando, mensajem #" + trans(MeuErro(1)) + " - ";
    + MeuErro(2)
endif
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform