Re: mldbm error

From: JS (vervoom_at_hotmail.com)
Date: 10/31/03


Date: Fri, 31 Oct 2003 11:18:52 +0000

Ben Morrow wrote:
> vervoom@hotmail.com wrote:
>
>>I have some code to print from a multi-level hash that has been stored
>>using mldbm:
>>
>>use MLDBM qw(DB_File Storable);
>>tie my %appstaffwk, 'MLDBM', $appstaffwkdb or die $!;
>>
>>foreach $app (keys %appstaffwk){
>> $hashref=$appstaffwk{$app};
>> foreach $staffno (keys %$hashref){
>> print "\n$app:$staffno:$hashref->{$staffno}";
>> }
>>}
>>
>
> <snip>
>
>>It gives me the below error (when I have diagnostics switched on):
>>
>
> <snip>
>
>> Uncaught exception from user code:
>> Storable binary image v24.8 more recent than I am (v2.6) at
>>blib/lib/Storable.pm (autosplit into blib/lib/auto/Storable/thaw.al)
>>line 364.
>
>
> I'm sorry to say this, but it looks to me like your database is
> corrupt. Storable seems to think that the data stored in the database
> was created by Storable.pm v24.8, but that won't be written for
> really *quite* some time...
>
> What happens when you run the following:
>
> use Data::Dumper;
> use MLDBM qw/DB_File Storable/;
>
> tie my %appstaffwk, MLDBM => $appstaffwkdb or die "tie failed: $!";
>
> for (keys %appstaffwk) {
> eval {
> print Dumper $appstaffwk{$_};
> 1;
> } or warn "\$appstaffwk{$_} is corrupt!\n";
> }
>
> __END__
>
> The eval{} is there so that if some of the entries are corrupt and
> others aren't, it'll carry on and try them all rather than dieing
> after the first.
>
> Ben
>

Thanks, you were right, the database was corrupted. I'm going to start
over again.

I just wondered, when I store my hash %appstaffwk which has 2 levels -
$appstaffwk{$app}{$staffno} my script which usually runs in 1 minute,
takes about 30 minutes. Is that normal? This is the code I've been using
to store the hash:

my $tmp=$appstaffwk{$app};
         if (! defined $tmp->{$staffno}){
                 $tmp->{$staffno}=1;
                 $appstaffwk{$app}=$tmp;
         }

It doesn't work if you just do:

$appstaffwk{$app}{$staffno}=1;

Is there anything I can do to make the hash storage faster?

Thanks,

JS.



Relevant Pages

  • Re: Form does no longer bind to table
    ... The symptoms you describe indicate that the form has become corrupt, ... Then compact the database to get completely rid of this stuff. ... > I'm only using VBA code and no macros. ... > The form does not bind without filter either. ...
    (microsoft.public.access.forms)
  • Re: There isnt enough memory? -- cannot open form
    ... When you tried the SaveAsText where were you? ... Try this - close the database then reopen it and open the VB Editor. ... > I've now tried "decompile" with no success. ... >> and keep a backup of the corrupt database. ...
    (microsoft.public.access.forms)
  • Re: Is my mdb corrupted ?
    ... If you suspect that a database is corrupt then I suggest that the first ... I have an mdb with the application and an mdb with the ... IS MY MDB CORRUPTED RESULTING IN THESE PROBLEM AND ERROR MESSAGE? ...
    (microsoft.public.access.modulesdaovba)
  • Information Store Corrupt - 3rd time!
    ... This is the 3rd time I have had the Information Store get corrupted in the ... Veritas Backup fails and complains that it could not backup the Information ... "Access Denied to Database Mailbox Store - Warning mailbox ... Store is a corrupt file. ...
    (microsoft.public.exchange2000.admin)
  • Iformation Store Corrupt - 3rd time!
    ... This is the 3rd time I have had the Information Store get corrupted in the ... Veritas Backup fails and complains that it could not backup the Information ... "Access Denied to Database Mailbox Store - Warning mailbox ... Store is a corrupt file. ...
    (microsoft.public.exchange2000.information.store)