If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > Pervasive.SQL > Pervasive caches too mach!?

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 01-28-04, 03:10
alfer alfer is offline
Registered User
 
Join Date: Jan 2004
Posts: 3
Lightbulb Pervasive caches too mach!?

HI

I have Samba on Linux with Pervasive. I have problems with quite small (from one record files to 150 records).
Sometimes I want to replace such a file on Samba. I simply overwrite an existing database file with a new one. I expect, that my application will see the new contents of a file (table). But applications use the old contents.
It looks like Pervasive uses its own cache, where such small tables are holded. Changing a file on disk, does not influence this cache. Applications, requiering access to this table, receive the old contens from the cache.
Am I right? How to disable this mechanism? My client needs to send database files from other cities via internet. Replacing files on other platforms (Novell) has always worked for me.

Thanks in advance
Rafal
Reply With Quote
  #2 (permalink)  
Old 01-28-04, 11:11
mirtheil mirtheil is offline
Registered User
 
Join Date: Dec 2001
Posts: 1,026
Closing the files before you copy them should address this problem. Any time a file is open, it is likely to have incorrect data if you try to copy it over the open file.
__________________
Mirtheil Software
Certified Pervasive Developer
Certified Pervasive Technician
Custom Btrieve/VB development
http://www.mirtheil.com
I do not answer questions by email. Please post on the forum.
Reply With Quote
  #3 (permalink)  
Old 02-26-04, 16:05
Dilyias Dilyias is offline
Registered User
 
Join Date: Feb 2004
Posts: 78
Re: Pervasive caches too mach!?

Quote:
Originally posted by alfer
HI

I have Samba on Linux with Pervasive. I have problems with quite small (from one record files to 150 records).
Sometimes I want to replace such a file on Samba. I simply overwrite an existing database file with a new one. I expect, that my application will see the new contents of a file (table). But applications use the old contents.
It looks like Pervasive uses its own cache, where such small tables are holded. Changing a file on disk, does not influence this cache. Applications, requiering access to this table, receive the old contens from the cache.
Am I right? How to disable this mechanism? My client needs to send database files from other cities via internet. Replacing files on other platforms (Novell) has always worked for me.

Thanks in advance
Rafal
Do you have a window of time (during the night) where you could just update the table files nightly? Then you could have a batch job stop the pervasive services (or daemons in linux?), copy in the new files, then start up the DBMS. This is what we do nightly and it works great if you don't mind restarting your DBMS every day.

Instead of stopping/starting the DBMS, you could also write a script that attempts to rename the working file, if that fails then it is open. Once the rename is successful, rename the new file to what the working file was.

OR you could clear out the table and then use butil -copy to load in the new data whenever you need to put new data in.
Reply With Quote
  #4 (permalink)  
Old 02-27-04, 02:14
alfer alfer is offline
Registered User
 
Join Date: Jan 2004
Posts: 3
Yes. I do so. But on Novell I can simply copy a new file and I don't have any problems. This problem is Linux specific.

As I have tested it is possible :
1-delete the file
2-copy a new one file
3-Pervasive notices that this file is new and works ok

Thanks for answers
Reply With Quote
  #5 (permalink)  
Old 02-27-04, 07:51
mirtheil mirtheil is offline
Registered User
 
Join Date: Dec 2001
Posts: 1,026
Pervasive on Linux and NetWare (and Windows) share a common code base. I would expect the engines to act very similarly. JUst out of curiosity, are the NetWare and Linux boxes running the same version of the Pervasive Engine? I know that that Pervasive had to change some of it's memory techniques on NetWare because of the TurboCache and false corruption of files but I don't think it would have the effect you are seeing. If the file is closed when it's deleted and recreated, it should work.
__________________
Mirtheil Software
Certified Pervasive Developer
Certified Pervasive Technician
Custom Btrieve/VB development
http://www.mirtheil.com
I do not answer questions by email. Please post on the forum.
Reply With Quote
  #6 (permalink)  
Old 02-27-04, 08:22
alfer alfer is offline
Registered User
 
Join Date: Jan 2004
Posts: 3
Yes Pervasive 2000i

As I said - I have this problem only on: Linux+Samba+Pervasive
Maybe Pervasive uses functions that relay on Samba, and the error (or bad documented function) is in Samba.
I'm sure that some important functions differ on Novell and Linux. I don't trust Pervasive, that everything acts in the same way.
Reply With Quote
  #7 (permalink)  
Old 02-27-04, 09:40
mirtheil mirtheil is offline
Registered User
 
Join Date: Dec 2001
Posts: 1,026
Having worked extensively with Pervasive for 8+ years, I've seen a lot of Pervasive behavior. FOr the most part, if a problem exists in one platform, it exists in all platforms.

Have you tried Pervasive.SQL V8? Does it behave the same way? Pervasive 2000i is going unsupported soon and isn't even being fixed if bugs are reported to Pervasive.
__________________
Mirtheil Software
Certified Pervasive Developer
Certified Pervasive Technician
Custom Btrieve/VB development
http://www.mirtheil.com
I do not answer questions by email. Please post on the forum.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On