Jump to content

flush cache to disk


This topic is 7316 days old. Please don't post here. Open a new topic instead.

Recommended Posts

we have a client who is going through switching through records and then adding a related record via a portal on given records... they are telling us that some times the record they add in the portal is being added but its causing the ones that were just added to other records portal disappear....

they were initially using filemaker server and said the problem went away when they switched to just using a workstation share to access them... though they now say they're having the same problem...

i reproduced the problem two times.... and can't see any logical reason why its doing this, the only fix i can find is to restart filemaker...

once, when I had the problem still in existance, i went and added a "flush cache to disk" command at the end of the script that adds the record to the portal... it seemed as though this actually fixed the problem. right? wrong... they called me the next day telling me the same problem was happening more frequently.. i looked at it again and found this to be true maybe... and when I took the flush cache step out (without closing the program after..) the problem instantly went away...

so, i really have no conclusion to the problem...first I thought the flush cache to disk to be the fix, then it seemed to be something that caused it to break...

i've looked everywhere on the web for details on the 'flush cache to disk' script step and havne't found more than a 2 sentence explanation of what I already know its supposed to do...

my question is this:

how is it possible that this step actually broke the program in one instance? what am i missing here that this step does internally...

(my next thought is to put the step in intermentantly in other parts of the program, so there are a few seconds between when the new records are added and the cache is flushed... any logic to it being a timing kinda thing?)

any other ideas?

Link to comment
Share on other sites

Take a MAJOR step back here. You are trying to apply fixes without really knowing what the problems are.

The fact that you can replicate the issue is a good sign.

First, make sure that EVERYBODY is running the latest revisions of Filemaker, sometimes a rogue outdated version can cause strange occurances.

Second, take a closer look at what is happening. Not just what appears on the screen, but what is really happening. Since you are working with portals, it might be an issue with screen redraw or a problem with how the relationship that the portal is based upon is setup.

You did not really describe your configuration, but my first instinct is that the design is flawed in some way, and I can think of hundreds of ways, and that is what is causing this problem.

Link to comment
Share on other sites

Without knowing more about your setup (files, keys, relationships, and script steps) it’s not really possible to give any great amount of help here. However, if I had to hazard a guess I would say that your relationship is screwed up in some way. Maybe your script is generating the key for the relationship? If this is so, look closely at how these keys are being generated, as maybe they are not unique in some way. Something is certainly not right somewhere, as this is a pretty easy function in FM. Maybe – just maybe your index is corrupted. In this case you need to do a recover on all the files.

Finding a problem in existing files is usually harder than creating new solutions, but if you persevere, you will find it.

Rigsby

Link to comment
Share on other sites

the relationship that isn't showing the record is based off of the PK in the current record and shows the FK from records in the other file..

the script that adds the record in the other file sets the fk of the newly added record based off of a global...

the fact that the newly added record *is* being shown in the portal based off of the relationship described 2 paragraphs ago... means that the record was in fact added ...or at least updated...and the global was properly set for the script to set the FK (or it wouldn't even show in the related records of the portal) ...to rule out that a new record is in fact being created (as opposed to just updating the last record of the file) i added a status check to ensure that a record was really added

-d

Link to comment
Share on other sites

Well, since your relationship is based on a global, and you are having problems with records not correctly showing up in the portal, I would first guess that the global is not being set correctly.

However it could also be the that portal is not being refreshed. A refresh screen script step might be needed.

Link to comment
Share on other sites

the global is only used for purposes of calling an external script located in the other file... the portal with the problems is a relationship from the current PK to a FK in another file...

if it were the global that were the problem, the bottom portal (the portal that has the relationship not based on any globals (pk->fk)) would never show the newly added record... because if the global was improper the new record would not have the proper FK for it to ever show in the portal, and it is in fact showing in the portal... the problem is that recently added records are sometimes disappearing, even after they've already been seen in the portal... a look at the actual file the portal is based on shows that the records have vanished..

i've added error traps to check the status of errors after the new record was added (i.e., it wasn't really added), to check if the globals aren't set or aren't a logical possibility, etc... and these ddon't seem to be triggered anywhere

Link to comment
Share on other sites

So you are SURE that the records are being properly created and that the various ID fields are being properly set?

Now do you have more than 1 portal on the screen? Do these portals use different relationships? Are your scripts for the creation of a new record using these portals? Any the scripts using any related fields with the same relationships as either of these portals?

Basically Filemaker makes no distinction amongst multiple portals on a screen. So this could either be a simple refresh issue, or it could be due to your use of portals or related fields in your scripting.

Link to comment
Share on other sites

quite positive... at first the client was just having user interface issues but then i reproduced the problem after a few hours of playing...

the layout in question has two portals:

[portal 1, lists available choices] the portal's relationship is a normal pk/fk relationship to a different file...the records on this portal have a script to add the item to the contents of the second portal... BUT, the script doesn't do this via the portal it calls an external script in the file the second portal is coming from to add the portal...

[portal 2, registered choices... shows based on the current record's PK relating to a FK of the registration record in a third file]

--- the script used in portal 1 to add the record first saves the current item to global, then calls the external script... the script then calls the external script that creates a new record and sets the fields in the new record global... then it returns back to the original script and the window refreshes...

at this point the new records are showing in the bottom portal.... most of the time the bottom portal has 2 or 3 records... but when this problem happens, only the records added before this session and the newest record show... in other words, if the user runs this script to add 3 different new registrations, they'll all run individually, and the new record will show in the botttom portal, but as soon as the script is ran to add another registration, the one that was just added disappears and only the newest is showing again (and any records added in previous sessions)...

Link to comment
Share on other sites

quote:

Originally posted by CaptKurt:

You are definately have a portal refresh problem. The cost of having dynamic portals is that they do not always refresh properly. This seems to be especially problematic with layouts with multiple portals.


If the problem exists in 5.5, please make sure to report it to FMI at www.filemaker.com

Link to comment
Share on other sites

You are definately have a portal refresh problem. The cost of having dynamic portals is that they do not always refresh properly. This seems to be especially problematic with layouts with multiple portals.

Honestly I just avoid multiple portals on the same layout. However try just switching layouts at the end of your scripted procedure. This seems to cause portals to refresh correctly. Also make sure that you throw an Exit Record step in there at the end, you may be getting stuck within one of the portals and thus it cannot refresh.

If you can eliminate having 2 portals on the screen you will likely have an easier time with refreshes, but if that is not possible the just do some layout switching.

[ October 09, 2001: Message edited by: CaptKurt ]

Link to comment
Share on other sites

You are telling me two different and conflicting pieces of information. On the one hand you are adamant that the records are being correctly created and all IDs correctly being set, now you are saying that they are "disappearing" from the database.

Short of a bad installation of Filemaker Pro records do NOT spontaneously get deleted. Either you are inadvertantly doing something, or something that you think is happening is not.

1st step is to VERIFY that the records are indeed being created and that the IDs are being properly set. Assuming that the records and IDs are being properly created, then the 2nd step is to VERIFY that the records are being deleted from the database.

The 3rd and possibly most important step is to VERIFY that nothing in your scripting or procedure is causing the issue. This is perhaps the only that will cause you the most problems, as you will have a hard time seeing the forest for the trees.

If you still have problems after steps 1 and 2, perhaps posting your scripts and a description of your procedures here will allow us to look and see if we notice anything out of the ordinary.

Link to comment
Share on other sites

I made one tentative comment on this problem, and then kept out of it until I had some more information, which I think I now have. My feelings are now as follows:

Maybe a FM / OS problem that is truly deleting records – I doubt it. Such problems are pretty rare and also tend to show up in other ways.

So, lets presume you have a clean system running the way it should:

You say you know the records are being created, but then after the problem occurs, they have disappeared. Well, have you really checked this? You MUST check the number of records before the problem and then compare this to the number after the new related records have been created and then after they have “disappeared”. If in these stages something like the following happens then records are being deleted:

1. You have 20 records in file A.

2. From another file (: you create another 5 as related records in file A

3. Now check (after you have created the new 5) if you have 25 records (total) in File A

4. Now (if you have 25) simulate the problem then see how many records you have in the related file A – (If you don’t have 25, then you know they are in fact not being created.) But if they are being created:

Possible results and answers:

a) You now have fewer than 25 = a script somewhere is deleting records

: You have 25, but the related records are not showing up = you have a calculation or script that is corrupting (i.e. destroying the validity of your key either left or right) / Or, you have a refresh problem that is simply stopping the records appearing in the portal / Or, the records are being over-written by something else that makes them seem like genuine records, but the key no longer works (CHECK FOR DOUBLES) here.

If we rule out a system/software error here, then somewhere you have made a mistake. Your problem is not something that anyone here can put down to experience, and say “I had this problem, too – so here’s the answer” So, we can only make guesses and then you have to check them… but to be honest from your comments, you seem to be saying “I have everything set up correctly but it’s not working” Maybe you’re right – then send the problem to FM and let them de-bug it. But I would lay money on an oversight somewhere in your solution. So! Here are my latest guesses/tips – accept them as a possibility, check them and then rule them out, or blow them down and say NO WAY! I really can’t think of how else this could be happening:

1. You have 2 problems: Portals are showing related records which are then being overwritten, but because the portal isn’t refreshing the way it should the old related records are not disappearing…. I’ve never had this happen, but I can imagine it’s possible

2. You are using pre-set global fields in calculations: I’ll explain:

Global A is set to the last record (or what ever) when the database starts. As an example lets take the last record 100. You start the database or another script and the global A is set to 101. Ok, this number is then used somewhere in a calculation to create a related record. No problem, except that someone else is starting the same database at the same time and getting the same global – so now you have the key 101 twice on the server. No one will see this until one or the other or both users exit and restart.

These are just a few feelings that I’m throwing about here.

Another thing I found quite interesting is that you say you are using an external script in the related file to create the new record! How are you then setting this record to values from the left file? How can you set the right-hand key, for example, without a relationship to the first file. And if you have a relationship, look at this to find your problem.

I know! I’m really jabbering here – but there are just so many things with the kind of complicated setup you have, that I don’t know where to begin!

Just food for thought - - - - - --

Rigsby

Link to comment
Share on other sites

but if its a portal refresh problem... why would the records completely disappear from the file the portal is based upon? why wouldn't they at least come back after moving to a different layout, or even closing the program and reopening?

-d

Link to comment
Share on other sites

This topic is 7316 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.