public SqlMapSession openSession(Connection conn) { try { SqlMapSessionImpl sqlMapSession = new SqlMapSessionImpl(this); sqlMapSession.open(); sqlMapSession.setUserConnection(conn); return sqlMapSession; } catch (SQLException e) { throw new SqlMapException("Error setting user provided connection. Cause: " + e, e); } }
public int delete(String id) throws SQLException { return delete(id, null); }
/** * TODO Deprecated * * @return Current connection * @throws SQLException * @deprecated */ public Connection getUserConnection() throws SQLException { return getCurrentConnection(); }
public SqlMapSession openSession() { SqlMapSessionImpl sqlMapSession = new SqlMapSessionImpl(this); sqlMapSession.open(); return sqlMapSession; }
protected SqlMapSessionImpl getLocalSqlMapSession() { SqlMapSessionImpl sqlMapSession = (SqlMapSessionImpl) localSqlMapSession.get(); if (sqlMapSession == null || sqlMapSession.isClosed()) { sqlMapSession = new SqlMapSessionImpl(this); localSqlMapSession.set(sqlMapSession); } return sqlMapSession; }
public void endTransaction() throws SQLException { try { getLocalSqlMapSession().endTransaction(); } finally { getLocalSqlMapSession().close(); } }
public void setUserConnection(Connection connection) throws SQLException { try { getLocalSqlMapSession().setUserConnection(connection); } finally { if (connection == null) { getLocalSqlMapSession().close(); } } }
public Object insert(String id) throws SQLException { return insert(id, null); }
public void commitTransaction() throws SQLException { getLocalSqlMapSession().commitTransaction(); }
public List executeBatchDetailed() throws SQLException, BatchException { return getLocalSqlMapSession().executeBatchDetailed(); }
public int executeBatch() throws SQLException { return getLocalSqlMapSession().executeBatch(); }
public void endTransaction() throws SQLException { try { getLocalSqlMapSession().endTransaction(); } finally { getLocalSqlMapSession().close(); } }
protected SqlMapSessionImpl getLocalSqlMapSession() { SqlMapSessionImpl sqlMapSession = (SqlMapSessionImpl) localSqlMapSession.get(); if (sqlMapSession == null || sqlMapSession.isClosed()) { sqlMapSession = new SqlMapSessionImpl(this); localSqlMapSession.set(sqlMapSession); } return sqlMapSession; }
public SqlMapSession openSession() { SqlMapSessionImpl sqlMapSession = new SqlMapSessionImpl(this); sqlMapSession.open(); return sqlMapSession; }
public void setUserConnection(Connection connection) throws SQLException { try { getLocalSqlMapSession().setUserConnection(connection); } finally { if (connection == null) { getLocalSqlMapSession().close(); } } }
public Object insert(String id) throws SQLException { return insert(id, null); }
public void commitTransaction() throws SQLException { getLocalSqlMapSession().commitTransaction(); }
public List executeBatchDetailed() throws SQLException, BatchException { return getLocalSqlMapSession().executeBatchDetailed(); }
public int executeBatch() throws SQLException { return getLocalSqlMapSession().executeBatch(); }
public SqlMapSession openSession(Connection conn) { try { SqlMapSessionImpl sqlMapSession = new SqlMapSessionImpl(this); sqlMapSession.open(); sqlMapSession.setUserConnection(conn); return sqlMapSession; } catch (SQLException e) { throw new SqlMapException("Error setting user provided connection. Cause: " + e, e); } }