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

You have show the cause of the SPT bug
...
? "Rollback Transaction:",SQLROLLBACK(con)

SQLEXEC(con,"select @@TRANCOUNT as count", "trancount")
? "Current trancount:",trancount.count

SQLEXEC(con,"select * from #testtransaction","currentstate")
SELECT currentstate
LIST

SQLSETPROP(con,"Transactions",1) <========= here !!!
...
I show 6 example for explain.

My examples without SQLEXEC.

Example A:
con=SQLCONNECT("LocalServer")     && point to any available SQL Server
SQLSETPROP(con,"Transactions",2)  && this not send commands
SQLSETPROP(con,"Transactions",1)  && this not send commands
SQLDISCONNECT(con)		  && this not send commands

Sql Profiler output:
-- none
Example B:
con=SQLCONNECT("LocalServer")     && point to any available SQL Server
SQLSETPROP(con,"Transactions",2)  && this not send commands
SQLDISCONNECT(con)		  && this not send commands

Sql Profiler output:
-- none
Example C:
con=SQLCONNECT("LocalServer")    && point to any available SQL Server
SQLSETPROP(con,"Transactions",2) && this not send commands
SQLCOMMIT(con)			 && this not send commands
SQLDISCONNECT(con)		 && this not send commands

Sql Profiler output:
-- none
Examples with SQLEXEC.

Example A1:
con=SQLCONNECT("LocalServer")     && point to any available SQL Server
SQLSETPROP(con,"Transactions",2)  && this not send commands
SQLEXEC(con,"",1)		  && send set implicit_transactions on 
SQLSETPROP(con,"Transactions",1)  && send IF @@TRANCOUNT > 0 COMMIT TRAN
SQLDISCONNECT(con)		  && this not send commands

Sql Profiler output:
SQL:BatchCompleted:	set implicit_transactions on
SQL:BatchCompleted:	
SQL:BatchCompleted:	IF @@TRANCOUNT > 0 COMMIT TRAN
Example B1:
con=SQLCONNECT("LocalServer")    && point to any available SQL Server
SQLSETPROP(con,"Transactions",2) && this not send commands
SQLEXEC(con,"",1)		 && send set implicit_transactions on 
SQLDISCONNECT(con)		 && send IF @@TRANCOUNT > 0 COMMIT TRAN

Sql Profiler output:
SQL:BatchCompleted:	set implicit_transactions on
SQL:BatchCompleted:	
SQL:BatchCompleted:	IF @@TRANCOUNT > 0 COMMIT TRAN
Example C1:
con=SQLCONNECT("LocalServer")     && point to any available SQL Server
SQLSETPROP(con,"Transactions",2)  && this not send commands
SQLEXEC(con,"",1)	          && send set implicit_transactions on 
SQLCOMMIT(con)			  && send IF @@TRANCOUNT > 0 COMMIT TRAN
SQLDISCONNECT(con)		  && this not send commands

Sql Profiler output:
SQL:BatchCompleted:	set implicit_transactions on
SQL:BatchCompleted:	
SQL:BatchCompleted:	IF @@TRANCOUNT > 0 COMMIT TRAN
On VFP, on one ODBC transaction=2, this command are identical:
* command A
SQLSETPROP(con,"Transactions",1)

* command B
SQLDISCONNECT(con)		

* command C
SQLCOMMIT(con)			
This is the cause of the problem.

Form me A is bad/bug, need to send IF @@TRANCOUNT > 0 ROOLBACK.
Form me B is bug, donnot send commands.
Form me C is correct.

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

Click here to load this message in the networking platform