Record not found rears its ugly head once again
I've encountered a situation which I find quite puzzling. I may need to create a smaller workspace that can reproduce the problem, but since that is probably a lot of work, let me describe the situation first:
I am testing some order entry scenarios for our application (not the order entry example that's provided with DataFlex Studio, although perhaps the same problem could be shown there). I have everything automated, even simulating the pressing of keys. Before every test run, I am running a script to restore the database (it takes only a second). Then a few order entry scenarios are running. After every scenario, I run a SQL script to delete the orders that have been created. And here is where the problem occurs. Presumably, if I delete the orders using dataflex commands, it would be ok. But when I do it using SQL statements, DataFlex gets confused.
So after the SQL delete statements, when the next order entry scenario is happening, when the order detail has been entered and the program tries to save, the save fails, with a "record not found" error.
I have tried to send "clear" messages to help DataFlex understand that there is no active record. But so far I have not been successful.
Has anyone seen anything like this? Is there a way to tell DataFlex that the database has been "reset", so all DataDictionary objects and global database buffers are regarded as empty?
Re: Record not found rears its ugly head once again
may be a stupid idea, but why not just send a "Broadcast Recursive No_Stop Send Clear of oMain"?
Should clear each and every one of the dds that are already loaded.
Re: Record not found rears its ugly head once again
it is obviously still thinking that it has some record in the buffer
What files are involved? any system files?
Re: Record not found rears its ugly head once again
[QUOTE=starzen;336767]it is obviously still thinking that it has some record in the buffer
What files are involved? any system files?[/QUOTE]
One thing i would do is to close and reopen all tables
We do this in systems were we switch databases on the fly
You need to
1) Remember all open tables and their file modes
2) Issue a CLOSE DF_ALL
3) Reopen all tables and reset their file modes
You also need to clear the DDs of course
Re: Record not found rears its ugly head once again
[QUOTE=GhostShotIV;336766]may be a stupid idea, but why not just send a "Broadcast Recursive No_Stop Send Clear of oMain"?
Should clear each and every one of the dds that are already loaded.[/QUOTE]
That wasn't stupid at all! It worked! Thanks :o
Re: Record not found rears its ugly head once again
[QUOTE=starzen;336767]What files are involved? any system files?[/QUOTE]
That question represents part of the problem :rolleyes: It's a monolithic application where finding out what is really going on is quite a challenge. So running automated regression tests is a tool which helps me figure out these things... Except when the tests won't run and I can't find out why :p
Re: Record not found rears its ugly head once again
[QUOTE=starzen;336768]One thing i would do is to close and reopen all tables[/QUOTE]
Thanks for the suggestion, Mike! This time a "Broadcast Recursive No_Stop Send Clear" did the trick, though.