Subject Re: Picture Servlet Problems possibly OT
Author Roman Rokytskyy
Ann,

> > As I understand, segment size influences
> >the way blob is stored on the database page.
>
> Yes, but you can store different length segments in a single blob.
> A segmented blob contains two bytes of segment length, followed by
> that many bytes of data, followed by the length of the next segment,
> that segment, etc.

Can actual length of one segment be bigger than segment length defined
in DDL statement?

> > Also it is used in blob
> >filters.
>
> The get_segment and put_segment calls are used in both stream and
> segmented blobs. In the case of a stream blob get_segment will
> return full buffers as long as there is still data in the blob.
> In the case of a segmented blob, get_segment will either return
> a segment which may be the size of the buffer or smaller, or it
> will return a full buffer and a status code saying that the
> segment is not yet complete.

Do I understand you correctly, that each call to isc_get_segment will
get _only one_ segment? So, when I have 16k buffer and 1k segment, I
will need to call isc_get_segment 16 times?

What happens in isc_put_segment if blob has 1k segments defined and
I'm writing 16k bytes? Will it be stored as 1 segment of 16k size, or
will it be stored as 16 segments of 1k size?

What happens if the size of the segment is bigger than page size? Is
such situation allowed?

> Length is easy in either case. Use the blob-info call. It returns
> the number of segments (segmented only, of course), the length of
> the longest segment (handy if you're constructing buffers on the
> fly), and the total length of the blob. Seek works only on stream
> blobs (because of the length bytes that occur at irregular intervals
> in segmented blobs), but it provides three modes - from start,
> from current position, and from end (requires a negative offset).

True. I had this code already working few months ago, but removed it
because driver was feature closed. I will merge that changes soon.

Thanks!
Roman