I have this code:
declare
v_bfile BFILE := BFILENAME('AMLDOWNLOAD_DIR', 'delta.xml');
v_clob CLOB;
v_xmlSource XMLTYPE;
BEGIN
DBMS_LOB.createtemporary (v_clob, TRUE, 10);
DBMS_LOB.fileopen(v_bfile, DBMS_LOB.file_readonly);
DBMS_LOB.loadfromfile(v_clob, v_bfile, DBMS_LOB.getlength(v_bfile));
DBMS_LOB.fileclose(v_bfile);
v_xmlSource := XMLTYPE(v_clob);
end;
It causes No more data to read from socket and problem is when i convert clob to XMLTYPE. I tried use v_xmlSource := XMLTYPE.createXML(v_clob); but same problem. If i change CACHE parameter on createtemporary to FALSE, it works. But where is the problem?
This is from trace file:
PARSING IN CURSOR #139965860986312 len=398 dep=0 uid=86 oct=47 lid=86 tim=1404989246886364 hv=751683459 ad='8cdab8b0' sqlid='0y3zd1cqcvjw3'
declare
v_bfile BFILE := BFILENAME('AMLDOWNLOAD_DIR', 'delta.xml');
v_clob CLOB;
v_xmlSource XMLTYPE;
BEGIN
DBMS_LOB.createtemporary (v_clob, TRUE, 10);
DBMS_LOB.fileopen(v_bfile, DBMS_LOB.file_readonly);
DBMS_LOB.loadfromfile(v_clob, v_bfile, DBMS_LOB.getlength(v_bfile));
DBMS_LOB.fileclose(v_bfile);
v_xmlSource := XMLTYPE.createXML(v_clob);
end;
END OF STMT
PARSE #139965860986312:c=6999,e=7075,p=0,cr=41,cu=0,mis=1,r=0,dep=0,og=1,plh=0,tim=1404989246886364
WAIT #139965860986312: nam='Disk file operations I/O' ela= 37 FileOperation=2 fileno=201 filetype=2 obj#=-1 tim=1404989246886892
WAIT #139965860986312: nam='BFILE open' ela= 77 =0 =0 =0 obj#=-1 tim=1404989246887113
WAIT #139965860986312: nam='BFILE get length' ela= 4 =0 =0 =0 obj#=-1 tim=1404989246887152
WAIT #139965860986312: nam='BFILE get length' ela= 3 =0 =0 =0 obj#=-1 tim=1404989246887192
WAIT #139965860986312: nam='BFILE internal seek' ela= 16 =0 =0 =0 obj#=-1 tim=1404989246887226
WAIT #139965860986312: nam='BFILE read' ela= 19 =0 =0 =0 obj#=-1 tim=1404989246887382
WAIT #139965860986312: nam='BFILE read' ela= 3 =0 =0 =0 obj#=-1 tim=1404989246887434
WAIT #139965860986312: nam='BFILE closure' ela= 17 =0 =0 =0 obj#=-1 tim=1404989246887517
*** 2014-07-10 12:47:26.889
Exception [type: SIGSEGV, Address not mapped to object] [ADDR:0x7F4D57634FE1] [PC:0x3EC2B35F4C, __GI___strncmp_ssse3()+44] [flags: 0x0, count: 1]
Incident 554808 created, dump file: /u01/app/oracle/diag/rdbms/a14ca4/a14ca4/incident/incdir_554808/a14ca4_ora_25187_i554808.trc
ORA-07445: výskyt výjimečného stavu: core dump [__GI___strncmp_ssse3()+44] [SIGSEGV] [ADDR:0x7F4D57634FE1] [PC:0x3EC2B35F4C] [Address not mapped to object] []