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: [email protected]
For additional commands, e-mail: [email protected]