Joshua Nathaniel Pritikin > ObjStore-1.59 > ObjStore::Reference

Download:
ObjStore-1.59.tar.gz

Annotate this POD

View/Report Bugs
Source  

NAME ^

ObjStore::Reference - a listing of APIs

SYNOPSIS ^

Fortunately, you will probably not need to use most of the API. In general, the API mostly mirrors the ObjectStore C++ API. Refer to the ObjectStore documentation for exact symantics.

DESCRIPTION ^

Primarily, the API is exhibited here to make it seem like this extension has a difficult and steep learning curve (it doesn't).

The API for ::UNIVERSAL is probably of greatest interest to ex-C++ developers.

ObjStore

::Server

::Database

Also see ObjStore::HV::Database.

::Root

::Transaction

ObjectStore transactions and exceptions are seemlessly integrated into perl. ObjectStore exceptions cause a die in perl just as perl exceptions can cause a transaction abort.

    begin 'update', sub {
        $top = $db->root('top');
        $top->{abc} = 3;
        die "Oops!  abc should not change!";       # aborts the transaction
    };
    die if $@;

There are three types of transactions: read, update, and abort_only. The default is read. Read transaction are blindingly fast.

    begin 'read', sub {
        my $var = $db->root('top');
        $var->{abc} = 7;        # write to $var triggers exception
    };
    die if $@;

(In a read transaction, you are not allowed to modify persistent data.)

Dynamic transactions are also available. See ObjStore::Serve.

::Segment

::Notification

Easy event dispatching for network distributed objects. See ObjStore::notify.

::UNIVERSAL

All persistent objects inherit from ObjStore::UNIVERSAL.

To make everything seem apparently consistent, ObjStore::Database (while not really being a storable object) is lavishly special-cased to support most (maybe all!) of the above features.

syntax highlighting: