Skip Menu |

This queue is for tickets about the TM CPAN distribution.

Report information
The Basics
Id: 27215
Status: resolved
Worked: 10 min
Priority: 0/
Queue: TM

People
Owner: Nobody in particular
Requestors: az [...] bond.edu.au
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: no way to create a tm::materialized::mldbm object
Date: Mon, 21 May 2007 12:53:08 +1000
To: bug-TM [...] rt.cpan.org
From: Alexander Zangerl <az [...] bond.edu.au>
tm: all versions including 1.26 when using TM::Synchronizable::MLDBM to create a db file with url file:./x.db from a topicmap that was sourced in from some other source, the sync_out method dies with this error: --- file './x.db' is not accessible (or does not exist) at /usr/share/perl5/TM/ResourceAble.pm line 147. --- * obviously the file i want to create does not exist yet, and it makes no sense for resourceable to attempt to access it. * furthermore, the access in resourceable does not reflect the files created: touching x.db gets one over the first hurdle, but the result is the creation of x.db.dir and x.db.pag... which of course are NOT checked on a subsequent run. * the resourcable/mldbm combination must be consistent: if one is supposed to produce .pag and .dir files, then the bloody other must check for those files, not some third unrelated ones. * next, the mldbm class uses MLDBM with the default db file type, which as per docs is not a good idea: -- Although SDBM_File is used by MLDBM by default, it is not a good choice if you're storing large data structures. Berkeley DB and GDBM both do not have these limits, so I recommend using either of those instead. -- instead of use MLDBM qw(MLDBM::Sync::SDBM_File); using use MLDBM qw(DB_File); would also get rid of the separate .dir/pag files and in one fast swoop take care of the file name discrepancies. regards az -- + Alexander Zangerl az@bond.edu.au DSA 0xF860ACF1 + + Bond University IT School phone +61 7 5595 3398 +
Download (untitled)
application/pgp-signature 189b

Message body not shown because it is not plain text.

On Sun May 20 22:54:40 2007, az@bond.edu.au wrote: Show quoted text
> tm: all versions including 1.26 > > when using TM::Synchronizable::MLDBM to create a db file > with url file:./x.db from a topicmap that was sourced in from > some other source, the sync_out method dies with this error: > > --- > file './x.db' is not accessible (or does not exist) > at /usr/share/perl5/TM/ResourceAble.pm line 147. > ---
1) An object of class TM::Materialized::MLDBM is per definition linked to a DBM file, not any other resource. 2) I cannot reproduce the error in 1.41 Show quoted text
> * furthermore, the access in resourceable does not reflect the > files created: touching x.db gets one over the first hurdle, but > the result is the creation of x.db.dir and x.db.pag... > which of course are NOT checked on a subsequent run.
No. Of course not. Show quoted text
> * next, the mldbm class uses MLDBM with the default db file type, > which as per docs is not a good idea: > -- > Although SDBM_File is used by MLDBM by default, it is not a good > choice if you're storing large data structures. Berkeley DB and > GDBM both do not have these limits, so I recommend using either of > those instead.
man MLDBM::Sync says use MLDBM qw(MLDBM::Sync::SDBM_File); # use extended SDBM_File, handles values > 1024 bytes Show quoted text
> instead of > use MLDBM qw(MLDBM::Sync::SDBM_File); > using > use MLDBM qw(DB_File); > would also get rid of the separate .dir/pag files and in one > fast swoop take care of the file name discrepancies.
Not that I insist on the current SDBM_File, but after quite some experimentation this was a version which worked reliably. It may be revisited at a later point, but there are more urgent things to do.