public void close() { session.close(); } }
public void setUserConnection(Connection connection) throws SQLException { session.setUserConnection(connection); }
public void commitTransaction() throws SQLException { session.commitTransaction(); }
public void performIndex(CompassSession session, IndexEntity[] entities) throws CompassException { for (IndexEntity entity : entities) { SqlMapIndexEntity indexEntity = (SqlMapIndexEntity) entity; SqlMapSession sqlMapSession = getSqlMapClient().openSession(); try { sqlMapSession.startTransaction(); if (log.isDebugEnabled()) { log.debug(buildMessage("Indexing select statement id [" + indexEntity.getStatementId() + "]")); } sqlMapSession.queryWithRowHandler(indexEntity.getStatementId(), indexEntity.getParam(), new SqlMapClientGpsDeviceRowHandler(indexEntity, session, pageSize)); session.evictAll(); sqlMapSession.commitTransaction(); } catch (SQLException e) { throw new SqlMapGpsDeviceException("Failed to fetch paginated list for statement [" + indexEntity.getStatementId() + "]", e); } finally { try { try { sqlMapSession.endTransaction(); } catch (Exception e) { log.warn(buildMessage("Failed to close sqlMap session, ignoring"), e); } } finally { sqlMapSession.close(); } } } } }
protected Object executeWith(Connection connection, SqlMapClientCallback action) { SqlMapSession session = getSqlMapClient().openSession(); try { try { session.setUserConnection(connection); } catch (SQLException e) { throw new CannotGetJdbcConnectionException("Could not get JDBC Connection", e); } try { return action.doInSqlMapClient(session); } catch (SQLException ex) { throw new SQLErrorCodeSQLExceptionTranslator().translate("SqlMapClient operation", null, ex); } } finally { session.close(); } }
public void startTransaction() throws SQLException { session.startTransaction(); }
public void endTransaction() throws SQLException { session.endTransaction(); }
public Connection getCurrentConnection() throws SQLException { return session.getCurrentConnection(); }
public DataSource getDataSource() { return session.getDataSource(); }
springCon = (transactionAware ? dataSource.getConnection() : DataSourceUtils .doGetConnection(dataSource)); session.setUserConnection(springCon); } catch (SQLException ex) { throw new CannotGetJdbcConnectionException("Could not get JDBC Connection", ex); session.close();
public void startTransaction(int transactionIsolation) throws SQLException { session.startTransaction(transactionIsolation); }
public void endTransaction() throws SQLException { session.endTransaction(); }
public Connection getCurrentConnection() throws SQLException { return session.getCurrentConnection(); }
public DataSource getDataSource() { return session.getDataSource(); }
Connection con = DataSourceUtils.getConnection(getDataSource()); try { session.setUserConnection(con); return action.doInSqlMapClient(session); session.close();
public void close() { session.close(); } }
public void setUserConnection(Connection connection) throws SQLException { session.setUserConnection(connection); }
public void startTransaction() throws SQLException { session.startTransaction(); }
public void commitTransaction() throws SQLException { session.commitTransaction(); }
public void startTransaction(int transactionIsolation) throws SQLException { session.startTransaction(transactionIsolation); }