Programmatic Interface

11. Programmatic Interface

So many functions, you'd go crazy!


Name
open-persistent-store, read-persistent-store - open a persistent store
procedure
Synopsis
(open-persistent-store file)
(read-persistent-store file)
Description

The (open-persistent-store) procedure is used to access an existing persistent object store. The root descriptor is read in and an initial set of virtual memory mappings are created so that the graph of objects in the store may begin to be accessed.

The (read-persistent-store) procedure is like (open-persistent-store), except that the store is opened for read access only. The underlying LSS volumes are not locked, and multiple processes may have the store open.

Restrictions

An LSS volume may not be open by more than one process for write at a time (this is enforced through the use of O_EXCL flags when opening the underlying store.)

A volume may not be open for read and write at the same time. However, this restriction is not enforced.

Errors

The following conditions may be signalled.

<os-error>

The file is not accessible or cannot be created.

<lss-error>

When opening a store, the file is not a legible LSS volume. It could be have been corrupted, or it could be not an LSS volume at all.


Name
create-persistent-store - create a persistent store
procedure
Synopsis
(create-persistent-store file)
Description

The (create-persistent-store) procedure is used to initialize a persistent object store on disk and open it for subsequent use. The persistent store so created is not initialized until the first call to (commit). If the program should crash or otherwise exit without ever performing the first commit, then a subsequent attempt to open the store will fail.

In fact, it will fail with a mysterious LSS Error 5001

Restrictions

An LSS volume may not be open by more than one process for write at a time (this is enforced through the use of O_EXCL flags when opening the underlying store.)

A volume may not be open for read and write at the same time. However, this restriction is not enforced.

Errors

The following conditions may be signalled.

<os-error>

The file is not accessible and cannot be created.

Post feedback about this page... Last modified 2012-12-23 13:23:51 UTC (1.79e+03 d ago)