I have used iBATIS for a cpouple of years now, and have not once seen
this sort of performance issue.

What is the database? what is the connection pooling mechanism? What
type is th Map that is getting returned?

Give us some more context...

Larry


On 6/9/05, Bing Zou <[EMAIL PROTECTED]> wrote:
> Am I doing anything wrong? Why iBATIS is so slow compared to JDBC?
> Thanks.
> ---------------------------------------------------------------------------------------------------------
> Using iBATIS to insert 1000 records: (38375 ms)
>             sqlMap.startBatch();
>             Map args = CollectionUtil.createMap(2);
>             for(int i=0;i<p_resultList.size();i++){
>                 AdvancedSearchResultData resultData =
> (AdvancedSearchResultData)p_resultList.get(i);
>                 args.put("RESULT_DATA", resultData);
>                 args.put("UserIdentifier", p_userID);
>                 sqlMap.insert("insertIntoTempTable", args);
>             }
>             sqlMap.executeBatch();
> 
>         INSERT INTO TEMPTABLE (ORDER_NUMBER, RESOURCE_ID,
> RESOURCE_TYPE_ID,USER_ID, ATTACHMENT_ID)
>         VALUES ( #RESULT_DATA.relevance#,
>                  #RESULT_DATA.resourceIdentifier.ID#,
>                  4,
>                  #UserIdentifier.ID#,
>                  #RESULT_DATA.attachmentIdentifier.ID# )
> 
> ---------------------------------------------------------------------------------------------------------
> Using JDBC to insert the same 1000 records (391 ms)
>             statement = connection.prepareStatement( ""INSERT INTO
> TEMP_FTS(ORDER_NUMBER,  RESOURCE_ID,
> RESOURCE_TYPE_ID,USER_ID,ATTACHMENT_ID) " +
>         "VALUES ( ?,?, 4, ?, ?)" );
>             for(int i=0;i<p_resultList.size();i++){
> 
>                 AdvancedSearchResultData resultData =
> (AdvancedSearchResultData)p_resultList.get(i);
>                 statement.setLong( 1, i );
>                 statement.setLong( 2, resultData.getResourceId() );
>                 statement.setLong( 3, p_userID.getID() );
>                 statement.setLong( 4, resultData.getAttachmentId() );
> // attachment_id
>                 statement.addBatch();
>             }
>             statement.executeBatch();
>

Reply via email to