Example usage for org.apache.ibatis.session SqlSession close

List of usage examples for org.apache.ibatis.session SqlSession close

Introduction

In this page you can find the example usage for org.apache.ibatis.session SqlSession close.

Prototype

@Override
void close();

Source Link

Document

Closes the session.

Usage

From source file:com.inform.project.dao.MyBatisGetEventsImpl.java

@Override
public List<UserEventModel> getEventForSells(UserEventModel event) {
    List<UserEventModel> list = null;
    SqlSession session = null;
    try {//from  www . ja va 2 s . c  om
        session = MyBatisSession.getInst().getSession().openSession();
        list = session.selectList("GetEventsMapper.getListForSell", event);
    } catch (IOException ex) {
        Logger.getLogger(MyBatisGetEventsImpl.class.getName()).log(Level.SEVERE, null, ex);
    } finally {
        if (session != null) {
            session.close();
        }
    }
    return list;
}

From source file:com.inform.project.dao.MyBatisGetEventsImpl.java

@Override
public List<UserEventModel> getEventForGroup(UserEventModel event) {
    List<UserEventModel> list = null;
    SqlSession session = null;
    try {//from ww w.j a va  2 s  .  c o  m
        session = MyBatisSession.getInst().getSession().openSession();
        list = session.selectList("GetEventsMapper.getListForGroup", event);
    } catch (IOException ex) {
        Logger.getLogger(MyBatisGetEventsImpl.class.getName()).log(Level.SEVERE, null, ex);
    } finally {
        if (session != null) {
            session.close();
        }
    }
    return list;
}

From source file:com.inform.project.dao.MyBatisGetLocationImpl.java

@Override
public List<UserLocationModel> getListLocation() {
    List<UserLocationModel> list = null;
    SqlSession session = null;
    try {//w  w  w . j av a  2  s. c o  m
        session = MyBatisSession.getInst().getSession().openSession();
        list = session.selectList("GetUsersLocationMapper.getLocationList");
    } catch (IOException ex) {
        Logger.getLogger(MyBatisGetEventsImpl.class.getName()).log(Level.SEVERE, null, ex);
    } finally {
        if (session != null) {
            session.close();
        }
    }
    return list;
}

From source file:com.inform.project.dao.MyBatisGetLocationImpl.java

@Override
public void setLocation(UserLocationModel loc) {
    SqlSession session = null;
    try {/* www.j  av  a  2 s  . c om*/
        session = MyBatisSession.getInst().getSession().openSession();
        session.insert("GetUsersLocationMapper.insertOne", loc);
        session.commit();
    } catch (IOException ex) {
        Logger.getLogger(MyBatisAdminImpl.class.getName()).log(Level.SEVERE, null, ex);
    } finally {
        if (session != null) {
            session.close();
        }
    }
}

From source file:com.inform.project.dao.MyBatisGetLocationImpl.java

@Override
public void delLocation(UserLocationModel loc) {
    SqlSession session = null;
    try {//from  w ww . ja  v a2  s.c om
        session = MyBatisSession.getInst().getSession().openSession();
        session.delete("GetUsersLocationMapper.deleteOne", loc);
        session.commit();
    } catch (IOException ex) {
        Logger.getLogger(MyBatisAdminImpl.class.getName()).log(Level.SEVERE, null, ex);
    } finally {
        if (session != null) {
            session.close();
        }
    }
}

From source file:com.inform.project.dao.MyBatisGetLocationImpl.java

@Override
public void updLocation(UserLocationModel loc) {
    SqlSession session = null;
    try {/*from ww  w. j a v a  2 s. co  m*/
        session = MyBatisSession.getInst().getSession().openSession();
        session.update("GetUsersLocationMapper.updateOne", loc);
        session.commit();
    } catch (IOException ex) {
        Logger.getLogger(MyBatisAdminImpl.class.getName()).log(Level.SEVERE, null, ex);
    } finally {
        if (session != null) {
            session.close();
        }
    }
}

From source file:com.inform.project.dao.MyBatisGetSellsImpl.java

@Override
public List<UserSellsModel> getListSells() {
    List<UserSellsModel> list = null;
    SqlSession session = null;
    try {/*from   w  w  w  .j  a  v a  2  s  .c  o m*/
        session = MyBatisSession.getInst().getSession().openSession();
        list = session.selectList("GetUsersSellsMapper.getSellsList");
    } catch (IOException ex) {
        Logger.getLogger(MyBatisGetEventsImpl.class.getName()).log(Level.SEVERE, null, ex);
    } finally {
        if (session != null) {
            session.close();
        }
    }
    return list;
}

From source file:com.inform.project.dao.MyBatisGetSellsImpl.java

@Override
public void setSells(UserSellsModel sell) {
    SqlSession session = null;
    try {// w w  w  .j  av a 2  s  .c  o  m
        session = MyBatisSession.getInst().getSession().openSession();
        session.insert("GetUsersSellsMapper.setSells", sell);
        session.commit();
    } catch (IOException ex) {
        Logger.getLogger(MyBatisAdminImpl.class.getName()).log(Level.SEVERE, null, ex);
    } finally {
        if (session != null) {
            session.close();
        }
    }
}

From source file:com.inform.project.dao.MyBatisGetSellsImpl.java

@Override
public void delSells(UserSellsModel sell) {
    SqlSession session = null;
    try {/*from  w  w  w  . j a v  a 2  s  . co m*/
        session = MyBatisSession.getInst().getSession().openSession();
        session.delete("GetUsersSellsMapper.deleteOne", sell);
        session.commit();
    } catch (IOException ex) {
        Logger.getLogger(MyBatisAdminImpl.class.getName()).log(Level.SEVERE, null, ex);
    } finally {
        if (session != null) {
            session.close();
        }
    }
}

From source file:com.inform.project.dao.MyBatisGetSellsImpl.java

@Override
public void updSells(UserSellsModel sell) {
    SqlSession session = null;
    try {//from w w  w.  j av  a2s  .co m
        session = MyBatisSession.getInst().getSession().openSession();
        session.update("GetUsersSellsMapper.updateOne", sell);
        session.commit();
    } catch (IOException ex) {
        Logger.getLogger(MyBatisAdminImpl.class.getName()).log(Level.SEVERE, null, ex);
    } finally {
        if (session != null) {
            session.close();
        }
    }
}