Abrantes Araújo Silva Filho wrote:
> The "ns_ora clob_dml_file" correctly inserted a small file as clob in
> the test table.
>
> The problem is with "ns_ora clob_get_file": when selecting the clob
> and writing it to a return file, the resulting file have a binary
> charset, and so a diff between the original file and the retrurned
> file fails (should be equal).
>
> The ORIGINAL file inserted on database (ns_ora clob_dml_file):
>> cat markd-small.txt
> this is a small test file
>
>> file -i markd-small.txt
> markd-small.txt: text/plain; charset=us-ascii
>
>
> The RETURNED file (ns_ora clob_get_file):
>> cat markd-small.txt-back
> this is a small test file
>
>> file -i markd-small.txt-back
> markd-small.txt-back: text/plain; charset=binary
>
>
> Now, aparently the problem is in ns_ora clob_get_file: it is writing a
> "binary" file insted of a "character" file:
> -rw-r--r-- 1 wwwrun      www        26 2012-08-18 13:54 markd-small.txt
> -rw------- 1 wwwrun      www      977K 2012-08-18 13:54 markd-small.txt-back
>
> Any ideas?


A few thoughts.

One strong possibility is that this code is old and worked fine against 
oracle 8 but hasn't been tested in a long time.

You could enable the oracle driver debugging: in the config file section 
"ns/db/driver/ora8" add in the parameter "ns_param Debug true".
This will log lots more stuff along the way, like the results of various 
OCI calls.

The differing file sizes makes it look like 'clob_get_file' is 
incorrectly getting the size of the lob.  Are the contents of the file 
"this is a small test file\0" over and over again, or is it "this is a 
small test file" followed by 976k of garbage?  The former suggests the 
lob reading got into a loop and didn't realize it needed to stop, the 
latter suggests a simple buffer overrun (and some amount of luck the 
server didn't crash).

Check the length of the inserted lob through independent means (e.g., 
sql*plus and an appropriate dbms_lob function)  Is it 26 or 977k? If the 
lob length in the database is wrong, then it points to clob_dml_file 
being broken.

If the problem really is just with clob_get_file and you are running 
openacs, you can probably ignore the problem as that function isn't used 
in openacs that I can tell.

Are you tied to oracle for business reasons?  Lots of people are running 
openacs quite well on postgresql, and quite a few people prefer 
postgresql over oracle in any case.

-J

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
aolserver-talk mailing list
aolserver-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/aolserver-talk

Reply via email to