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

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

Introduction

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

Prototype

void commit();

Source Link

Document

Flushes batch statements and commits database connection.

Usage

From source file:org.mobicents.servlet.restcomm.dao.mybatis.MybatisNotificationsDao.java

License:Open Source License

private void removeNotifications(final String selector, final Sid sid) {
    final SqlSession session = sessions.openSession();
    try {//from   www. j av a 2  s.  c o  m
        session.delete(selector, sid.toString());
        session.commit();
    } finally {
        session.close();
    }
}

From source file:org.mobicents.servlet.restcomm.dao.mybatis.MybatisOutgoingCallerIdsDao.java

License:Open Source License

@Override
public void addOutgoingCallerId(final OutgoingCallerId outgoingCallerId) {
    final SqlSession session = sessions.openSession();
    try {/*from  w  w w  . j a va 2s  . c  o  m*/
        session.insert(namespace + "addOutgoingCallerId", toMap(outgoingCallerId));
        session.commit();
    } finally {
        session.close();
    }
}

From source file:org.mobicents.servlet.restcomm.dao.mybatis.MybatisOutgoingCallerIdsDao.java

License:Open Source License

private void removeOutgoingCallerIds(final String selector, final Sid sid) {
    final SqlSession session = sessions.openSession();
    try {/*from www .j  av a 2 s.c  o m*/
        session.delete(selector, sid.toString());
        session.commit();
    } finally {
        session.close();
    }
}

From source file:org.mobicents.servlet.restcomm.dao.mybatis.MybatisOutgoingCallerIdsDao.java

License:Open Source License

@Override
public void updateOutgoingCallerId(final OutgoingCallerId outgoingCallerId) {
    final SqlSession session = sessions.openSession();
    try {/*from  ww w.j  a v  a 2  s .  c  o  m*/
        session.update(namespace + "updateOutgoingCallerId", toMap(outgoingCallerId));
        session.commit();
    } finally {
        session.close();
    }
}

From source file:org.mobicents.servlet.restcomm.dao.mybatis.MybatisRecordingsDao.java

License:Open Source License

@Override
public void addRecording(Recording recording) {
    if (s3AccessTool != null) {
        URI s3Uri = s3AccessTool.uploadFile(recordingPath + "/" + recording.getSid().toString() + ".wav");
        if (s3Uri != null) {
            recording = recording.updateFileUri(s3Uri);
        }//from  w  w w.  j a va  2s .c  o m
    } else {
        recording = recording.updateFileUri(generateLocalFileUri("/restcomm/recordings/" + recording.getSid()));
    }
    final SqlSession session = sessions.openSession();
    try {
        session.insert(namespace + "addRecording", toMap(recording));
        session.commit();
    } finally {
        session.close();
    }
}

From source file:org.mobicents.servlet.restcomm.dao.mybatis.MybatisRecordingsDao.java

License:Open Source License

private void removeRecording(final String selector, final Sid sid) {
    final SqlSession session = sessions.openSession();
    try {//  ww  w . j a v  a  2s. c o  m
        session.delete(selector, sid.toString());
        session.commit();
    } finally {
        session.close();
    }
}

From source file:org.mobicents.servlet.restcomm.dao.mybatis.MybatisRegistrationsDao.java

License:Open Source License

@Override
public void addRegistration(final Registration registration) {
    final SqlSession session = sessions.openSession();
    try {/*  w  w  w.  j  av a2s  . c  om*/
        session.insert(namespace + "addRegistration", toMap(registration));
        session.commit();
    } finally {
        session.close();
    }
}

From source file:org.mobicents.servlet.restcomm.dao.mybatis.MybatisRegistrationsDao.java

License:Open Source License

@Override
public void removeRegistration(final Registration registration) {
    final SqlSession session = sessions.openSession();
    try {/*  w ww.  j av a 2s.co  m*/
        session.delete(namespace + "removeRegistration", toMap(registration));
        session.commit();
    } finally {
        session.close();
    }
}

From source file:org.mobicents.servlet.restcomm.dao.mybatis.MybatisRegistrationsDao.java

License:Open Source License

@Override
public void updateRegistration(final Registration registration) {
    final SqlSession session = sessions.openSession();
    try {//  www. j a v a2  s.  com
        session.update(namespace + "updateRegistration", toMap(registration));
        session.commit();
    } finally {
        session.close();
    }
}

From source file:org.mobicents.servlet.restcomm.dao.mybatis.MybatisShortCodesDao.java

License:Open Source License

@Override
public void addShortCode(final ShortCode shortCode) {
    final SqlSession session = sessions.openSession();
    try {/*from w ww.ja  v  a 2 s  .  c  om*/
        session.insert(namespace + "addShortCode", toMap(shortCode));
        session.commit();
    } finally {
        session.close();
    }
}