Runtime considerations
Because of limitations of the BS2000 process model, the
driver can be loaded only after the Apache server has forked
off its server child processes. This will slightly slow
down the initial SESAM request of each child, but subsequent
accesses will respond at full speed.
When explicitly defining a Message Catalog for SESAM, that
catalog will be loaded each time the driver is loaded (i.e.,
at the initial SESAM request). The BS2000 operating system
prints a message after successful load of the message catalog,
which will be sent to Apache's error_log file. BS2000 currently
does not allow suppression of this message, it will slowly
fill up the log.
Make sure that the SESAM OML PLAM library and SESAM configuration
file are readable by the user id running the web server.
Otherwise, the server will be unable to load the driver,
and will not allow to call any SESAM functions. Also, access
to the database must be granted to the user id under which
the Apache server is running. Otherwise, connections to
the SESAM database handler will fail.
Cursor Types
The result cursors which are allocated for SQL "select
type" queries can be either "sequential"
or "scrollable". Because of the larger memory
overhead needed by "scrollable" cursors, the default
is "sequential".
When using "scrollable" cursors, the cursor can
be freely positioned on the result set. For each "scrollable"
query, there are global default values for the scrolling
type (initialized to: SESAM_SEEK_NEXT) and the scrolling
offset which can either be set once by sesam_seek_row()
or each time when fetching a row using sesam_fetch_row().
When fetching a row using a "scrollable" cursor,
the following post-processing is done for the global default
values for the scrolling type and scrolling offset:
Table 2. Scrolled Cursor Post-Processing
Scroll Type Action
SESAM_SEEK_NEXT none
SESAM_SEEK_PRIOR none
SESAM_SEEK_FIRST set scroll type to SESAM_SEEK_NEXT
SESAM_SEEK_LAST set scroll type to SESAM_SEEK_PRIOR
SESAM_SEEK_ABSOLUTE Auto-Increment internal offset value
SESAM_SEEK_RELATIVE none. (maintain global default offset
value, which allows for, e.g., fetching each 10th row backwards)
Porting note
Because in the PHP world it is natural to start indexes
at zero (rather than 1), some adaptions have been made to
the SESAM interface: whenever an indexed array is starting
with index 1 in the native SESAM interface, the PHP interface
uses index 0 as a starting point. E.g., when retrieving
columns with sesam_fetch_row(), the first column has the
index 0, and the subsequent columns have indexes up to (but
not including) the column count ($array["count"]).
When porting SESAM applications from other high level languages
to PHP, be aware of this changed interface. Where appropriate,
the description of the respective PHP sesam functions include
a note that the index is zero based.
Security concerns
When allowing access to the SESAM databases, the web server
user should only have as little privileges as possible.
For most databases, only read access privilege should be
granted. Depending on your usage scenario, add more access
rights as you see fit. Never allow full control to any database
for any user from the 'net! Restrict access to PHP scripts
which must administer the database by using password control
and/or SSL security.