[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: Object Store question

The lower levels of the ObjectStore (objectstore.h/cpp and qdisam.h/cpp)
don't require that the objects you put in the ObjectStore are encoded in
ASN.1 (they do use the buffer_t objects that are defined in the ASN.1
header files, so you have to build and link against the asn.1 classes, but
the data you're storing doesn't have to be in asn.1).  In Jonah, the
ObjectStore is cached via a layer called the ObjectCache, which does
require that the objects are asn.1 encoded (one purpose of the ObjectCache
is to minimize the number of asn.1 encode/decode operations that have to be
performed, so it caches the objects in their parsed state).

The layering is pretty simple.  From bottom to top:

o    QDISAM is a pretty general purpose storage system that lets you store
arbitrary sized records into a file, assigning an integer key to each
record.  This key is what Jonah calls an ObjectStore ID.

o    ObjectStore just puts an O-O wrapper around qdisam, and supports some
Jonah conventions regarding the encoding of the flag values that can be
associated with each ObjectStore record.

o    ObjectCache maintains an in-memory cache of asn.1-encoded objects,
backed by the ObjectStore on-disk store.  It also adds some mutexes to
single-thread the accesses to the ObjectStore layer (which isn't
thread-safe by itself).

If you want to use the ObjectStore directly from another project, it should
work (provided you don't want to run Jonah against the same ObjectStore,
and provided you make sure you aren't invoking operations from multiple
threads simultaneously).

It looks as though ostest wasn't upgraded when we fixed some tagging bugs
in the asn.1 definitions, which is causing the compilation errors you're
seeing.  But I think it uses the ObjectCache layer anyway, so it's probably
not what you want.  You could look at osread.cpp, which is a little
debugging utility that pulls a record out of the ObjectStore by key, and
writes it to a file.  It uses the qdisam layer directly (bypassing the
ObjectCache and ObjectStore), so it probably is more in-line with what
you're looking for.


Tolani Ravi-FRT222 <Ravi.Tolani@xxxxxxxxxxxx>@imc.org on 02/01/2000
12:18:11 PM

Sent by:  owner-imc-pfl@xxxxxxx

To:   "Jonah Mailing List (E-mail)" <imc-pfl@xxxxxxx>

Subject:  RE: Object Store question

     I have included my response on the specific error message.
-----Original Message-----
From: Mike Shanzer [mailto:shanzer@xxxxxxxxxx]
Sent: Tuesday, February 01, 2000 7:13 AM
To: Ravi.Tolani
Subject: Re: Object Store question

Ravi Tolani wrote:
> Hi
>     I am trying to using the objectStore in a project and was wondering
> if someone could shed some light on its use. Is it possible to use the
> ObjectStore to store binary data which is not ASN1 encoded. I would like
> to use the store to manage certain certificates which comprise of a BLOB
> of data.
The way the object store is currently set up the the actual data does need
to be asn.1 encoded. If you want to store a blob of data you can store it
as an asn.1 encoded octetstring.

> Also, I was able to compile the ObjectStore as a seperate dll but have
> been unable to compile the ostest.cpp program which resides in the same
> directory as ObjectStore.  Has anyone been able to get it to work
What was the error you were getting? we never tried to do this, but
I do not see what it would not work. There might be some dependencies
on things in OSSRV and of course asn.1.

Here is my response. I am getting a compile time error when I try to
the ostest.cpp file. I have appended my response at the end. Apparently it
is becuase it cannot find the definitions of the members of ObjStoreData
which have been explicitly instantiated.

Thanks for your help

-------------------Configuration: ObjectStoreTest - Win32
D:\WTLS\ObjectStore\ostest.cpp(104) : error C2039: 'directoryname' : is not
a member of 'asn_explicit<class GeneralName,2,1>'
D:\WTLS\ObjectStore\ostest.cpp(104) : error C2228: left of
must have class/struct/union type
D:\WTLS\ObjectStore\ostest.cpp(105) : error C2039: 'select' : is not a
member of 'asn_explicit<class GeneralName,2,1>'
D:\WTLS\ObjectStore\ostest.cpp(106) : error C2039: 'set_value' : is not a
member of 'asn_explicit<class asn_ia5String,2,2>'
D:\WTLS\ObjectStore\ostest.cpp(107) : error C2039: 'set_value' : is not a
member of 'asn_explicit<class asn_octetstring,2,3>'
D:\WTLS\ObjectStore\ostest.cpp(175) : error C2039: 'directoryname' : is not
a member of 'asn_explicit<class GeneralName,2,1>'
D:\WTLS\ObjectStore\ostest.cpp(175) : error C2228: left of
must have class/struct/union type
D:\WTLS\ObjectStore\ostest.cpp(201) : error C2039: 'directoryname' : is not
a member of 'asn_explicit<class GeneralName,2,1>'
D:\WTLS\ObjectStore\ostest.cpp(201) : error C2228: left of
must have class/struct/union type
D:\WTLS\ObjectStore\ostest.cpp(228) : error C2039: 'directoryname' : is not
a member of 'asn_explicit<class GeneralName,2,1>'
D:\WTLS\ObjectStore\ostest.cpp(228) : error C2228: left of
must have class/struct/union type
D:\WTLS\ObjectStore\ostest.cpp(256) : error C2039: 'directoryname' : is not
a member of 'asn_explicit<class GeneralName,2,1>'
D:\WTLS\ObjectStore\ostest.cpp(256) : error C2228: left of
must have class/struct/union type
Error executing cl.exe.

ostest.obj - 13 error(s), 1 warning(s)