Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
TableUpdate not committing records with Op Table Buffering?
Message
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Title:
TableUpdate not committing records with Op Table Buffering?
Environment versions
Visual FoxPro:
VFP 8 SP1
OS:
Windows XP SP2
Network:
Windows 2000 Server
Database:
Visual FoxPro
Miscellaneous
Thread ID:
00994219
Message ID:
00994219
Views:
70
I have Data Environment Class, the process is as follows:
1. open the database in BeforeOpenTables
2. use all tables with buffering set 5 (Optimistic Table Buffering)
3. attach the DE class to a private data session form
4. on the form, I have a method called DeleteBill which deletes records from various related
tables, then the method calls another method which inserts a record in a table. After that
the changes are committed to the tables using TableUpdate. The following is the code
structure:
** DeleteBill Method
**delete records related to the bill
** Call another method called insertlog
m.llSuccess = this.insertlog()
if m.llSuccess ;
then 
   for i = 1 to 30
	begin transaction 
	if tableupdate(2,.t.,'table1') ;
	then 
	   if tableupdate(2,.t.,'table2') ;
	   then 
	      if tableupdate(2,.t.,'table3') ;
	      then 
	         m.llSuccess = .t.
	      endif 
	   endif 
	endif 
	if m.llSuccess ;
	then 
	  end transaction 
	  exit 
	esle 
	  rollback 
	endif 
   next 
endif 
**Insertlog method
insert into table3 values ("Bill deleted")
for i = 1 to 30
	begin transaction 
	if tableupdate(2,.t.,'table3') ;
	then 
          m.llSuccess = .t.
	endif 
	if m.llSuccess ;
	then 
	  end transaction 
	  exit 
	esle 
	  rollback 
	endif 
next 
return m.llSuccess 
Changes in table1,table2 were committed but not in table3.
I was able to browse table3 and see the inserted records when probe into the table within that the data session of the form.

Why is this happening? Has anybody encounterd something like this?
TIA
Dawa Tsering


"Do not let any unwholesome talk come out of your mouths,
but only what is helpful for building others up according to their needs,
that it may benefit those who listen."

- Ephesians 4:29-30 NIV

Dare to Question -- Care to Answer

Time is like water in a sponge, as long as you are willing you can always squeeze some.

--Lu Xun, Father of Modern Chinese Literature

Next
Reply
Map
View

Click here to load this message in the networking platform