You are viewing a plain text version of this content. The canonical link for it is here.
Posted to asp@perl.apache.org by Joshua Chamas <jo...@chamas.com> on 2002/05/15 12:16:02 UTC

Re: MLDBM Tie Errors

Mike Martinet wrote:
> 
> Are you suggesting that I modify Sync.pm?
> 
> MjM
> 

No.  I had asked for an error_log trace with Debug set to -1
to help solve your specific problem.  My last bit about

  tie %hash, "MLDBM::Sync", $storage, O_RDWR | O_CREAT, 0660;
  tied(%hash)->Lock;

was more relevant to Franck's problem.  If you want, you could
try something like

# global.asa
sub Script_OnStart {
  $Session->Lock();
}

to similar effect.  Also the SessionSerialize config 
achieve this as well.  But I do not know that these things
will fix your problem, and if they don't I'll need to see
that error_log system debug trace.

--Josh

> joshua@chamas.com wrote:
> 
>  > Franck PORCHER wrote:
>  >
>  >>Well, I'm not 100% sure, but I recently switched for MLDBM and got this
>  >>problem too. Here is what I found, and did to remedy the situation :
>  >>
>  >>It *seemed* to me that the physical MLDBM repository was not
> physically created
>  >>until I actually wrote something into it, eventhough it was reported as
>  >>correctly open RW.
>  >>
>  >>
>  >
>  > This is correct.  This is a performance enhancement, with the side effect
>  > that write errors will occur at runtime.
>  >
>  >
>  >>So, any ends of my application trying to fetch value during this
>  >>transcient stage got this kind of error (I do not remember
>  >>precisely which one I got, but very close indeed).
>  >>
>  >>I solved the problem by doing an awful trick on each RW opening, such as
>  >>:
>  >>
>  >>eval {
>  >>       tie %hash, "MLDBM::Sync", $storage, O_RDWR | O_CREAT, 0660;
>  >>       $hash{'__DuMmY__'} = 'OK';
>  >>       delete $hash{'__DuMmY__'};
>  >>     };
>  >>
>  >>That solved the problem in the midtime, waiting for something
>  >>much better...
>  >>
>  >>
>  >
>  > You could also
>  >
>  >   tie %hash, "MLDBM::Sync", $storage, O_RDWR | O_CREAT, 0660;
>  >   tied(%hash)->Lock;
>  >
>  > to similar effect, as Lock() will actually force a tie to
>  > the dbm on disk.
>  >
>  > The basic premise of MLDBM::Sync is that the tie/untie actually
>  > occur at the reads & writes, so that i/o is flushed correctly.
>  >
>  > --Josh
>  > _________________________________________________________________
>  > Joshua Chamas                           Chamas Enterprises Inc.
>  > NodeWorks Founder                       Huntington Beach, CA  USA
>  > http://www.nodeworks.com                1-714-625-4051
>  >

---------------------------------------------------------------------
To unsubscribe, e-mail: asp-unsubscribe@perl.apache.org
For additional commands, e-mail: asp-help@perl.apache.org