Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Again, troubles with CursorAdapter
Message
De
15/08/2003 05:48:00
 
 
À
14/08/2003 19:08:42
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00819734
Message ID:
00820416
Vues:
29
Hi,

all true, but only if my program is perfect, otherwise it is not sure.

If my program have a bug, i can destroy my clients databases.
Ok next i stop the job of all my clients ( all to the sea go ),
debug my application, found the bug .... Absurdity

Example:
local lnHandle
lnHandle=SQLStringConnect('DRIVER=SQL Server;SERVER=??????;Trusted_connection=Yes')

? SQLSETPROP(lnHandle,"Transactions",2)

? SQLEXEC(lnHandle, "USE pubs")
? SQLEXEC(lnHandle, "CREATE TABLE Test (Tx VARCHAR(20))")
? SQLEXEC(lnHandle, "INSERT Test (Tx) VALUES  ('scrittura')")
* simulation of bug, MY PROGRAM EXIT
QUIT
? SQLROLLBACK(lnHandle)
? SQLDISCONNECT(lnHandle)
the sequence on MSSQL is:
> mssql commands
> -- SQLSETPROP(lnHandle,"Transactions",2)
> set implicit_transactions on 
> -- SQLEXEC(lnHandle, "USE pubs")
* USE pubs
> -- SQLEXEC(lnHandle, "CREATE TABLE Test (Tx VARCHAR(20))")
* CREATE TABLE Test (Tx VARCHAR(20))
> -- SQLEXEC(lnHandle, "INSERT Test (Tx) VALUES  ('scrittura')")
* INSERT Test (Tx) VALUES  ('scrittura')
> --  event QUIT VFP
* IF @@TRANCOUNT > 0 COMMIT TRAN -- you have a autocommit !!!!!
open pubs, Test table exist with a record inserted !
but my program haven't execute SQLCOMMIT(lnHandle).

FOR use SQLSETPROP(lnHandle,"Transactions",2) on VFP,

VFPT must resolve this BIG BUG.

when a connection with Transactions=2 is open
and VFP quit,

VFP must send this command
IF @@TRANCOUNT > 0 ROLLBACK
Until VFP send IF @@TRANCOUNT > 0 COMMIT TRAN i need to use
SQLEXEC(lnHandle, "BEGIN TRAN")
for increment @@TRANCOUNT .

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

Click here to load this message in the networking platform