Hey Dmitriy,

2011/2/8 Dmitriy Igrishin <[email protected]>:
> Hey all,
>
> Please note, that BLOB and bytea are different concepts in PostgreSQL:
>
> Large object (BLOB) - is a special structure which provides stream-style
> access
> to data.

I guess this corresponds to this feature request:
http://redmine.emweb.be/issues/700

>
> bytea - is a data type for storing binary strings.
>
> To process data of bytea type you need to retrieve the whole object
> from the database into a memory. Next, you may use WMemoryResource
> or save retrieved data to the file and use WFileResource.
>
> If you want to avoid working with whole objects (to avoid memory overheads)
> you may want to use BLOB. To do this you need to extend WResource.
>
> Btw, I think it is reasonable to add WStreamResource into Wt -- the same as
> WFileResource but for working with std::istream. I consider it useful.
> Koen, how do you think ?

I believe something like this is a good idea, but for a resource there
is never a guarantee that there is only one reader at a given time
(e.g. if you link the same resource from multiple images, or, for a
static resource, or, if the browser simply decides to fetch it twice).
This relates to the behaviour of HTTP 'GET' which is supposed to be
idempotent.

So, a WStreamResource would need to be able to seek into the given
std::istream (corresponding to the current reading position of
different readers). It is not entirely clear to me if istream's
generally support this? e.g. I cannot imagine you can do it on
std::cin ?

In any case, I believe it diserves a feature request and perhaps
WFileResource could be refactored to be a specializiatino of a
WStreamResource.

Regards,
koen

------------------------------------------------------------------------------
The ultimate all-in-one performance toolkit: Intel(R) Parallel Studio XE:
Pinpoint memory and threading errors before they happen.
Find and fix more than 250 security defects in the development cycle.
Locate bottlenecks in serial and parallel code that limit performance.
http://p.sf.net/sfu/intel-dev2devfeb
_______________________________________________
witty-interest mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/witty-interest

Reply via email to