Package org.apache.ibatis.session

Examples of org.apache.ibatis.session.SqlSession.commit()


        try {
            for (String statement : statements) {
                session.update(statement.trim(), data);
            }
        } finally {
            session.commit();
            session.close();
        }
    }

    public List<?> poll(MyBatisConsumer consumer, MyBatisEndpoint endpoint) throws Exception {
View Full Code Here


                result = session.insert(statement);
                doProcessResult(exchange, result);
            }
        } finally {
            try {
                session.commit();
            } finally {
                session.close();               
            }
        }
    }
View Full Code Here

                result = session.insert(statement);
                doProcessResult(exchange, result);
            }
        } finally {
            try {
                session.commit();
            } finally {
                session.close();               
            }
        }
    }
View Full Code Here

                result = session.update(statement);
                doProcessResult(exchange, result);
            }
        } finally {
            try {
                session.commit();
            } finally {
                session.close();               
            }
        }
    }
View Full Code Here

                result = session.delete(statement);
                doProcessResult(exchange, result);
            }
        } finally {
            try {
                session.commit();
            } finally {
                session.close();               
            }
        }
    }
View Full Code Here

                break;
            default:
                throw new IllegalArgumentException("Unsupported statementType: " + endpoint.getStatementType());
            }
            // flush the batch statements and commit the database connection
            session.commit();
        } catch (Exception e) {
            // discard the pending batch statements and roll the database connection back
            session.rollback();
            throw e;
        } finally {
View Full Code Here

                break;
            default:
                throw new IllegalArgumentException("Unsupported statementType: " + endpoint.getStatementType());
            }
            // flush the batch statements and commit the database connection
            session.commit();
        } catch (Exception e) {
            // discard the pending batch statements and roll the database connection back
            session.rollback();
            throw e;
        } finally {
View Full Code Here

            Person person = personMapper.selectById(1);
            person.setFirstName("Simone");
           
            // Execute first update then commit.
            personMapper.update(person);
            sqlSession.commit();
           
            // Execute same update a second time. This used to raise an NPE.
            personMapper.update(person);
            sqlSession.commit();
        } finally {
View Full Code Here

            personMapper.update(person);
            sqlSession.commit();
           
            // Execute same update a second time. This used to raise an NPE.
            personMapper.update(person);
            sqlSession.commit();
        } finally {
          sqlSession.close();
        }
    }
    @Test
View Full Code Here

            Person person = personMapper.selectById(1);
            person.setFirstName("Simone");
           
            // Execute first update then commit.
            personMapper.update(person);
            sqlSession.commit();
           
            // Execute same update a second time. This used to raise an NPE.
            personMapper.update(person);
            sqlSession.commit();
        } finally {
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.