I caught a BIG bug 'OutOfMemoryError' and then my system crashed.The following shows message in Tomcat4.1.27 console:
2004-5-8 15:31:59 com.ibatis.db.sqlmap.MappedStatement runQueryForList
Fatal error: Error Executing 'queryIfaceFileList' in 'com/hgam/persiste
nce/sql/rcv/IfaceFile.xml'. Check the Result Map. Check the 'accept_id'
property. Cause: java.lang.OutOfMemoryError
java.lang.OutOfMemoryError
I noticed that some messages in this forum suggested to:
1.Upgrade to 1.3.1 (from 1.2.8)
2.Set useBeansMetaClasses="false"
I did follow this but I still caught the problem.
Something I think have to describe here:
1.I use oracle 9 and use DBLink:
-- Create database link
create public database link OADbLink
connect to OA2AM identified by 'abc'
using 'DBOA2AM';
-- Create the new synonym
create synonym OA_FILE
for OA2AM.ARCH_FILE@OADbLink;
2.Because I want to count the record returned,I change some code in runQueryForList method in MappedStatement.java like this(thoughts?):
rs.last();
rowAmount = rs.getRow();
Will this crash my system?
Any ideas?Thanks.
Thanks.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
The statement 'queryIfaceFileList' will crash my system if I don't set any condition(means that the resultset returned will be 200,000 more records),but it's good when I set the condition to make the amount of the records down(20,000 for example).
What crash my system and throw 'OutOfMemoryError' error?I don't think oracle can't deal with 200,000 more records.
Thanks.
The following is my statement:
<dynamic-mapped-statement name="queryIfaceFileList" result-map="ifaceFile" >
SELECT
FILE_ID,
A.EFORM_ID,
PHASE_ID,
UP_PHASE_ID,
PARENT_FILE_ID,
PROJ_ID,
PROJ_NAME,
FILE_NUM,
DECODE(A.FILE_TITLE,NULL,B.EFORM_NAME,A.FILE_TITLE) AS FILE_TITLE,
FILE_DUTY,
FILE_DATE,
FILE_PAGE_AMOUNT,
FILE_TYPE,
FILE_KEYWORDS,
FILE_STATUS,
FILE_PATHNAME,
A.REMARK,
ACCEPT_ID
FROM OA_FILE A,OA_EDEFINE B
WHERE FILE_STATUS = '1'
AND SUBSTR(A.EFORM_ID,length(A.EFORM_ID)-4,2)='00'
AND A.EFORM_ID=B.EFORM_ID(+)
<dynamic>
<isNotEmpty prepend="AND" property="file_num">
FILE_NUM LIKE '%' || #file_num# || '%'
</isNotEmpty>
<isNotEmpty prepend="AND" property="file_title">
FILE_TITLE LIKE '%' || #file_title# || '%'
</isNotEmpty>
<isNotEmpty prepend="AND" property="proj_id">
PROJ_ID LIKE '%' || #proj_id# || '%'
</isNotEmpty>
<isNotEmpty prepend="AND" property="proj_name">
PROJ_NAME LIKE '%' || #proj_name# || '%'
</isNotEmpty>
<isNotEmpty prepend="AND" property="accept_id">
ACCEPT_ID LIKE '%' || #accept_id# || '%'
</isNotEmpty>
<isNotEmpty prepend="AND" property="phase_id">
PHASE_ID=#phase_id#
</isNotEmpty>
<isNotEmpty prepend="AND" property="up_phase_id">
UP_PHASE_ID=#up_phase_id#
</isNotEmpty>
</dynamic>
ORDER BY
FILE_ID DESC
</dynamic-mapped-statement>
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I caught a BIG bug 'OutOfMemoryError' and then my system crashed.The following shows message in Tomcat4.1.27 console:
2004-5-8 15:31:59 com.ibatis.db.sqlmap.MappedStatement runQueryForList
Fatal error: Error Executing 'queryIfaceFileList' in 'com/hgam/persiste
nce/sql/rcv/IfaceFile.xml'. Check the Result Map. Check the 'accept_id'
property. Cause: java.lang.OutOfMemoryError
java.lang.OutOfMemoryError
I noticed that some messages in this forum suggested to:
1.Upgrade to 1.3.1 (from 1.2.8)
2.Set useBeansMetaClasses="false"
I did follow this but I still caught the problem.
Something I think have to describe here:
1.I use oracle 9 and use DBLink:
-- Create database link
create public database link OADbLink
connect to OA2AM identified by 'abc'
using 'DBOA2AM';
-- Create the new synonym
create synonym OA_FILE
for OA2AM.ARCH_FILE@OADbLink;
2.Because I want to count the record returned,I change some code in runQueryForList method in MappedStatement.java like this(thoughts?):
rs.last();
rowAmount = rs.getRow();
Will this crash my system?
Any ideas?Thanks.
Thanks.
Well, depending on exactly how many records we're talking about here, rs.last() might not be a very good way to count the rows.
You're better off using:
select count(1) from...
Cheers,
Clinton
The statement 'queryIfaceFileList' will crash my system if I don't set any condition(means that the resultset returned will be 200,000 more records),but it's good when I set the condition to make the amount of the records down(20,000 for example).
What crash my system and throw 'OutOfMemoryError' error?I don't think oracle can't deal with 200,000 more records.
Thanks.
The following is my statement:
<dynamic-mapped-statement name="queryIfaceFileList" result-map="ifaceFile" >
SELECT
FILE_ID,
A.EFORM_ID,
PHASE_ID,
UP_PHASE_ID,
PARENT_FILE_ID,
PROJ_ID,
PROJ_NAME,
FILE_NUM,
DECODE(A.FILE_TITLE,NULL,B.EFORM_NAME,A.FILE_TITLE) AS FILE_TITLE,
FILE_DUTY,
FILE_DATE,
FILE_PAGE_AMOUNT,
FILE_TYPE,
FILE_KEYWORDS,
FILE_STATUS,
FILE_PATHNAME,
A.REMARK,
ACCEPT_ID
FROM OA_FILE A,OA_EDEFINE B
WHERE FILE_STATUS = '1'
AND SUBSTR(A.EFORM_ID,length(A.EFORM_ID)-4,2)='00'
AND A.EFORM_ID=B.EFORM_ID(+)
<dynamic>
<isNotEmpty prepend="AND" property="file_num">
FILE_NUM LIKE '%' || #file_num# || '%'
</isNotEmpty>
<isNotEmpty prepend="AND" property="file_title">
FILE_TITLE LIKE '%' || #file_title# || '%'
</isNotEmpty>
<isNotEmpty prepend="AND" property="proj_id">
PROJ_ID LIKE '%' || #proj_id# || '%'
</isNotEmpty>
<isNotEmpty prepend="AND" property="proj_name">
PROJ_NAME LIKE '%' || #proj_name# || '%'
</isNotEmpty>
<isNotEmpty prepend="AND" property="accept_id">
ACCEPT_ID LIKE '%' || #accept_id# || '%'
</isNotEmpty>
<isNotEmpty prepend="AND" property="phase_id">
PHASE_ID=#phase_id#
</isNotEmpty>
<isNotEmpty prepend="AND" property="up_phase_id">
UP_PHASE_ID=#up_phase_id#
</isNotEmpty>
</dynamic>
ORDER BY
FILE_ID DESC
</dynamic-mapped-statement>