Operating System - OpenVMS
1830044 Members
9444 Online
109998 Solutions
New Discussion

looking for help:global sections that created by using sys$crmpsc lose data

 
likuair_1
Advisor

looking for help:global sections that created by using sys$crmpsc lose data

i used sys$crmpsc to creat a section with a file named *.section,after install the section,i used sys$mgblsc to map data to the section.when i restart the alpha computer and reinstall the section,sometimes the data in the section was right,but sometimes the data was lost or wrong.
what's the problem with my action?
3 REPLIES 3
John Gillings
Honored Contributor

Re: looking for help:global sections that created by using sys$crmpsc lose data

likuair,

How are you closing down the program that writes the data? You can force data written by the current process to be written back to disk with the $UPDSEC service.

You can specify a flag to write all pages back. Also note the service is asynchronous.

There's no simple means for making your program crash proof. Even if you update the section file after every write there, may still be timing windows where data can be lost. You may also find that the performance hit from having to update the disk after every update defeats the purpose of using a section file in the first place.

Cheap, Fast, Reliable, pick TWO.
A crucible of informative mistakes
likuair_1
Advisor

Re: looking for help:global sections that created by using sys$crmpsc lose data

I have also tried using sys$updsecw after mapping data,but the problem has still happened.
And the flag that I used was
flags = SEC$M_WRT | SEC$M_GBL;
Are there really no means to sovle the problem?
maybe I can creat a new file named b.dat,and every hour write data that storing in the *.section to b.dat.When the problem happened ,I can rewrite the data in b.dat back to *.section.Is it OK?
Andy Bustamante
Honored Contributor

Re: looking for help:global sections that created by using sys$crmpsc lose data


Our database makes extensive use of global sections. When the application has a clean shutdown there's no issues, but when a system is restarted after a crash, we have to rebuild any global sections. This leads to additional downtime after a crash.

We write files to signal normal shutdown/restart or unknown state rebuild required to restart proceedures.

As John points out, writing to disk negates many of the speed advantages using global sections.

Andy
If you don't have time to do it right, when will you have time to do it over? Reach me at first_name + "." + last_name at sysmanager net