Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> OCILobRead Problem

OCILobRead Problem

From: Tilo Prütz <tilo_at_pruetz.net>
Date: Wed, 08 Dec 2004 10:05:26 +0100
Message-ID: <pan.2004.12.08.09.05.25.558569@pruetz.net>


Hi,

I am developing an Objective C application (using the GNU runtime on Linux(x86), Solaris and Windows) which connects to an oracle server via an adaptor instance. For BLOBs I have build a stream class which uses this instance.

The adaptor opens the creates the OCILobLocator using OCIDescriptorAlloc:

I am linking against 8.0.5 libraries. I could not find OCILobOpen in my includes. Maybe they're incomplete? Nevertheless it works without.

The stream reads piecewise using the adaptors read method which does the following:

Finally the blob get closed when the stream sends a close to the adaptor:

I have running a 9i server on Windows XP. This all works fine with my app running on solaris. It also works fine with my app running on Linux (x86) or Windows as long as the stream completly reads the blob.

It crashes on Linux and Windows if the stream reads only a part of the blob and then the adaptor reads the rest. The adaptor successfully reads the remaining data, successfully frees the descriptor but between returning from the close method and calling the next method in the stream I get an segmentation fault. When I comment out the 'read to the end' block in the adaptor it doesn't crash but the next database operation (commit transaction) fails with an ORA-3127 because the blob reading was not finished. When I move the 'read to the end' block into the stream to be executed hust before it sends close to the adaptor everything works fine.

I double checked all used buffers. They are okay.

Any suggestions on this?
Is my whole blob reading approach wrong?

regards

Tilo Prütz

P.S.: Sorry for my bad english. Received on Wed Dec 08 2004 - 03:05:26 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US