Return-Path: Delivered-To: apmail-commons-user-archive@www.apache.org Received: (qmail 68726 invoked from network); 11 Mar 2010 13:28:46 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 11 Mar 2010 13:28:46 -0000 Received: (qmail 98795 invoked by uid 500); 11 Mar 2010 13:28:12 -0000 Delivered-To: apmail-commons-user-archive@commons.apache.org Received: (qmail 98646 invoked by uid 500); 11 Mar 2010 13:28:11 -0000 Mailing-List: contact user-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Commons Users List" Delivered-To: mailing list user@commons.apache.org Delivered-To: moderator for user@commons.apache.org Received: (qmail 82277 invoked by uid 99); 11 Mar 2010 03:57:13 -0000 X-ASF-Spam-Status: No, hits=1.0 required=10.0 tests=SPF_HELO_PASS,SPF_SOFTFAIL X-Spam-Check-By: apache.org Received-SPF: softfail (athena.apache.org: transitioning domain of sic_1234@naver.com does not designate 216.139.236.158 as permitted sender) Date: Wed, 10 Mar 2010 19:56:47 -0800 (PST) From: sic To: user@commons.apache.org Message-ID: <1268279807291-1588407.post@n4.nabble.com> In-Reply-To: References: <1268044267460-1584311.post@n4.nabble.com> <4B965600.9080707@gmail.com> <338854607.4958511268145329373.JavaMail.root@zimbra5-e1.priv.proxad.net> <1268197824529-1586964.post@n4.nabble.com> Subject: Re: [dbcp] Re: Oracle session excess over maxActive MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit I just manage connections by raw code. simple pseudo-code is that : private DataSource ds; public void test() { Connection conn = null; PreparedStatement pstmt = null; ResultSet rs = null; try { conn = ds.getConnection(); pstmt = conn.prepareStatement(sql); rs = pstmt.executeQuery(); ... conn.commit(); } catch (Exception e) { ... } finally { if (rs != null) { try { rs.close(); } catch (SQLException e) { } } if (pstmt != null) { try { pstmt.close(); } catch (SQLException e) { } } if (conn != null) { try { conn.close(); } catch (SQLException e) { } } } } if using Spring's JDBC stuff as you mentioned, pseudo is following in my thought : try { conn = DataSourceUtils.getConnection(ds); pstmt = conn.prepareStatement(sql); rs = pstmt.executeQuery(); ... conn.commit(); } catch (Exception e) { ... } finally { JdbcUtils.closeResultSet(rs); JdbcUtils.closeStatement(pstmt); DataSourceUtils.releaseConnection(connection, ds); } If understanding ur advice correctly, I'll use this and observe the situation whereafter. -- View this message in context: http://n4.nabble.com/Oracle-session-excess-over-maxActive-tp1584311p1588407.html Sent from the Commons - User mailing list archive at Nabble.com. --------------------------------------------------------------------- To unsubscribe, e-mail: user-unsubscribe@commons.apache.org For additional commands, e-mail: user-help@commons.apache.org