Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Transaction cause program hang
Message
From
05/08/2007 11:27:40
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Title:
Transaction cause program hang
Environment versions
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Network:
Windows 2000 Server
Database:
MS SQL Server
Miscellaneous
Thread ID:
01246020
Message ID:
01246020
Views:
60
Hi,
I have code as below. It cause program hang when update 2nd record at TABLEUPDATE() line.
		CURSORSETPROP("Buffering", 5, "Items")
		CURSORSETPROP("Buffering", 5, "Books")

		lnConn = CURSORGETPROP("ConnectHandle", "Items")
		lnCommitted = 0
		lnUnCommitted = 0
		  
		SQLSETPROP(lnConn,"Transactions", 2)

		SELECT join_c
		SCAN
			SCATTER NAME loRecord MEMO
			
			SELECT Items
			APPEND BLANK
			GATHER NAME loRecord MEMO
			
			SELECT Books
			APPEND BLANK
			GATHER NAME loRecord MEMO
				
			IF TABLEUPDATE(.T., .F., "Items") AND TABLEUPDATE(.T., .F., "Books")
				SQLCOMMIT(lnConn)
				SELECT join_c
				RAISEEVENT(THIS, "UpdateStatus", "Item code: " + ItemCode + " Item Name:" + ItemName + " is updated.")
				lnCommitted = lnCommitted + 1  
			ELSE
				AERROR(laError)
				TABLEREVERT(.T., "Items")
				TABLEREVERT(.T., "Books")
				
				SQLROLLBACK(lnConn)

				SELECT join_c
				RAISEEVENT(THIS, "UpdateStatus", "Error: " + laError[3] + ;
												 " Item code: " + ItemCode + ;
												 " Item Name: " + ItemName)
				lnUnCommitted = lnUnCommitted + 1 
			ENDIF
		ENDSCAN
Any ideas?
I am not the most powerful man in this world.
I am not the worst man in this world either.
I just as same as all of you.
I still need to learn from my mistakes...
Reply
Map
View

Click here to load this message in the networking platform