Notice & Contact

  • Cooperation between JenniferSoft and Caucho Technology

  • JenniferSoft USA

    360 Fairview Way Milpitas, CA 95035
    Tel : +1-408-946-5508
    Fax : +1-408-946-5509
    sales@jennifersoft.com
    tech@jennifersoft.com

    JenniferSoft Japan

    2F VillaSK Bldg,6-5-8 Sotokanda, Chiyoda-ku, Tokyo, Japan
    Tel :+81-3-5809-1600
    Fax :+81-3-5809-1610
    info.jp@jennifersoft.com

    JenniferSoft Korea

    StarValley 1104, Gasan-dong 60-11, Geumcheon-gu, Seoul, Korea
    Tel :+82-2-2027-0397
    Fax :+82-2-2027-0390
    info.ko@jennifersoft.com

    Print

    Q&A

    How to analyze alert message..
    [ Name: guest, Date: 08-07-08 16:49:48 ] ( ko en ja )
    Edit | Delete

    Hi!

    I don’t know a root cause of ‘JDBC PreparedStatement NOT CLOSED’ error.

    ========================== JENNIFER 3.2 Message ================================ 60 48.8% /Sale/CreditSaleStatus.jsp JDBC PreparedStatement NOT CLOSED

    sql:[SELECT ISNULL,0) AS SAL_AMT, ISNULL,0) AS SAL_VAT, ISNULL,0) AS COL_AMT FROM SL100V01 WHERE CONVERT, SAL_DT, 112) = ? AND CUST_CD = ? ][], pstmt created public java.sql.PreparedStatement < init > public PreparedStatement java.sql.Connection.prepareStatement(String)

    ================================================================================

    And here is attached file including method information from CreditSaleStatus.jsp page with TXT type. PreparedStatement is using cleanup method,

    /** * Connection, PreparedStatement, ResultSet을 Close한다. * @param conn Connection (Connection from connection pool) * @param pstmt PreparedStatement (PreparedStatement) * @param rs ResultSet (Data result set) * @return Initialize connection-based data. * @exception */ public static void cleanup( Connection conn, PreparedStatement pstmt, ResultSet rs ) { try { if (rs != null) rs.close(); } catch (Exception e) { e.printStackTrace(); }

    try {
            if (pstmt != null) pstmt.close();
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
    try {
        if (conn != null) conn.close();
    } catch (Exception e) {
        e.printStackTrace();
    }

    I closed PreparedStatement like the above way, so I can’t understand why JENNIFER sends such alert message. Even I see same message in terms of ResultSet.

    Did I make some mistake when I close PreparedStatement?

    Filename Title Size
    사용중메소드.txt 7,807 Bytes
    pstmt is not closed...
    [ Name: 지나가다.., Date: 08-07-09 14:08:19 ] ( ko en ja )
    Edit | Delete

    As I see the code,

    you generated PreparedStatement saveral times but not to close them except 1…

    Generation pstmt = conn.prepareStatement(useQuery.toString());

    I guess you thought pstmt was closed by referring to the below. pstmt.clearParameters();

    The role of clearParameters() method is not to close pstmt.

    If you know that wheb you see javadoc. The method is just make clear already set parameter value.

    Therefore,

    pstmt.setString( 2, pSaleParam0 );

    just clear pstmt not to close it.

    Because of this unclosed pstmt, memory leakage problem happened.