Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Again, troubles with CursorAdapter
Message
From
15/08/2003 13:45:02
 
 
To
14/08/2003 19:08:42
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00819734
Message ID:
00820602
Views:
40
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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform