Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Creating a new order on two PCs
Message
From
13/07/2016 12:48:40
 
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
01638327
Message ID:
01638333
Views:
75
>Hi,
>
>I have a situation where one customer is experiencing the following: two users (on different PCs) create a new order and if they do it pretty much at the same time, the second one overwrites the first. The DB is SQL Server. The method of updating the DB is CursorAdapter.
>
>Here is the segment of the code dealing with creating new order:
>
>
>INSERT INTO V_ORDERS ( STATUS, DATE_OPEN,  OPEN_TIME, USER_NAME, USER_ID, INSP_PASS, SITE_NO ) VALUES ;
>				('O', DATE(), time(), oPassword.UserName(), oPassword.User_Password_Id(), NULL, this.site_no )
>
>	IF !TABLEUPDATE(0,.T., "V_ORDERS" )
>		AERROR(aErrorInfo)
>		this.error_message_text = aErrorInfo[1,2]
>		this.error_number = aErrorInfo[1,1]
>		this.error_message_title = "Failed TABLEUPDATE() of V_ORDERS"	
>		RETURN .F.
>	ENDIF
>
>
>The error (which is logged) does not seem to fire. But is it possible that the TABLEUPDATE() takes "time" (a second or two or more) to actually update the SQL Server. And therefore, the second user's TABLEUPDATE() overwrites the first one? If this is the case, how do I "force" the tableupdate to be faster? Or any other suggestions to deal with this situation?
>

Is there an Insert trigger on the SQL Server table? If so, what does it do?

Tamar
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform