Ajesh
1st June 2013, 12:21
Hello
I tried to search the Core Files Topic but didn't find the relevant one so i am opening a new Topic here.
My Session tries to process a large number of records. Apparently the number of records is 9 lakhs.
And i have tried to process the records in the batch of 50k Records. But as soon i am through with around 3 4 Lakh Records i get a Message of "Running out of Memory" and then it exits and i get a Core File.
Header = true
Last.Batch = False
cins.inter.f = cins.f
While Last.Batch = false
count = 0
file.initiation()
select tssma102.*
from tssma102 for update
where tssma102._index1 inrange {:cins.inter.f}
and {:cins.t}
and tssma102.orno <> 0
order by tssma102._index1
selectdo
select tdsls041.orno
from tdsls041
where tdsls041._index1 = {:tssma102.orno,:tssma102.pono}
Selectdo
count = count + 1
if Header = true then
update.desc = enum.descr$("tcyesno",form.update)
Curr.date = sprintf$("%D(Date: %02d/%02m/%04Y)",
date.num())
file.input = "Update = " & update.desc & ", " &
strip$(Curr.date) & " " & Current.time & ", " &" User: "& logname$
seq.puts(file.input, file.pointer)
file.input = ""
file.input(1;20) = "Installation"
file.input(21;1) = ";"
file.input(22;9) = "SO Number"
file.input(31;1) = ";"
file.input(32;10) = "SO Line No"
seq.puts(file.input, file.pointer)
Header = false
endif
file.input(1;20) = str$(strip$(shiftl$(tssma102.cins)))
file.input(21;1) = ";"
file.input(22;9) = str$(tssma102.orno)
file.input(31;1) = ";"
file.input(32;10) = str$(tssma102.pono)
ret.val = seq.puts(file.input, file.pointer)
if form.update = tcyesno.yes then
tssma102.owno.c = str$(tssma102.orno) & "-" & str
$(tssma102.pono)
tssma102.orno = 0
tssma102.pono = 0
db.update(ttssma102,db.retry)
endif
if count = 100000 then
select d102.cins:cins.inter.f
from tssma102 d102
where d102._index1 > {:tssma102.cins}
as set with 1 rows
selectdo
endselect
break
endif
endselect
if count = 100000 then
break
endif
selecteos
Last.Batch = true
endselect
if form.update = tcyesno.yes and count <> 0 then
commit.transaction()
ret.val = seq.close(file.pointer)
else
if count <> 0 then
ret.val = seq.close(file.pointer)
endif
endif
ENDWHILE
For some reason i think the Clue to this would be the session releasing the records from its buffer to Update.
Any Clues Anyone?
Regards
Ajesh
I tried to search the Core Files Topic but didn't find the relevant one so i am opening a new Topic here.
My Session tries to process a large number of records. Apparently the number of records is 9 lakhs.
And i have tried to process the records in the batch of 50k Records. But as soon i am through with around 3 4 Lakh Records i get a Message of "Running out of Memory" and then it exits and i get a Core File.
Header = true
Last.Batch = False
cins.inter.f = cins.f
While Last.Batch = false
count = 0
file.initiation()
select tssma102.*
from tssma102 for update
where tssma102._index1 inrange {:cins.inter.f}
and {:cins.t}
and tssma102.orno <> 0
order by tssma102._index1
selectdo
select tdsls041.orno
from tdsls041
where tdsls041._index1 = {:tssma102.orno,:tssma102.pono}
Selectdo
count = count + 1
if Header = true then
update.desc = enum.descr$("tcyesno",form.update)
Curr.date = sprintf$("%D(Date: %02d/%02m/%04Y)",
date.num())
file.input = "Update = " & update.desc & ", " &
strip$(Curr.date) & " " & Current.time & ", " &" User: "& logname$
seq.puts(file.input, file.pointer)
file.input = ""
file.input(1;20) = "Installation"
file.input(21;1) = ";"
file.input(22;9) = "SO Number"
file.input(31;1) = ";"
file.input(32;10) = "SO Line No"
seq.puts(file.input, file.pointer)
Header = false
endif
file.input(1;20) = str$(strip$(shiftl$(tssma102.cins)))
file.input(21;1) = ";"
file.input(22;9) = str$(tssma102.orno)
file.input(31;1) = ";"
file.input(32;10) = str$(tssma102.pono)
ret.val = seq.puts(file.input, file.pointer)
if form.update = tcyesno.yes then
tssma102.owno.c = str$(tssma102.orno) & "-" & str
$(tssma102.pono)
tssma102.orno = 0
tssma102.pono = 0
db.update(ttssma102,db.retry)
endif
if count = 100000 then
select d102.cins:cins.inter.f
from tssma102 d102
where d102._index1 > {:tssma102.cins}
as set with 1 rows
selectdo
endselect
break
endif
endselect
if count = 100000 then
break
endif
selecteos
Last.Batch = true
endselect
if form.update = tcyesno.yes and count <> 0 then
commit.transaction()
ret.val = seq.close(file.pointer)
else
if count <> 0 then
ret.val = seq.close(file.pointer)
endif
endif
ENDWHILE
For some reason i think the Clue to this would be the session releasing the records from its buffer to Update.
Any Clues Anyone?
Regards
Ajesh