[NeoStats-Devel] DBA
"M" <[email protected]> Thu, 29 Sep 2005 23:16:10 +0100
| Newsgroups | gmane.comp.neostats.devel |
|---|---|
| Message-ID | <[email protected]> |
I came across a bug in the DBA layer tonight which meant that tables never actually closed. This has now been fixed. This fixes the intent of changes made a few weeks ago in that all DBA calls now make the following assumption. If the associated table is not open, open it, process, then close. If the associated table is open, process and leave it open. Where we know we want to make several DBA calls for things like config data and exclusions we first open the table, then make the DBA calls we need, then close the table. Calls that are less frequent, eg a save from a SET command or EXCLUDE ADD/DEL will use a DBA call with a closed table so the DBA will open the table, perform the save, then close the table. So far, only config and exclusions specifically "optimise" their database usage. Some other calls are automatically "optimal" since they tend to read all rows so the default system works well for them. Persistence is handled in this system by calling DBAOpenTable at some point prior to any DBA calls. E.g. Statserv calls DBAOpenTable during init and DBACloseTable during fini for it's data tables. This means the tables are always open for the frequent saves required. StatServ is the only module to currently use persistent open databases due to it's frequent saves. The result of this is no need for timers to try and guess some random point that will never cover all causes at which to close tables or flags to exclude certain data from this process. The onus is on the user of the data. Mark.