Search in sources :

Example 6 with SqlMapSessionImpl

use of com.ibatis.sqlmap.engine.impl.SqlMapSessionImpl in project druid by alibaba.

the class SqlMapClientImplWrapper method getLocalSqlMapSessionWrapper.

protected SqlMapSessionWrapper getLocalSqlMapSessionWrapper() {
    try {
        if (getLocalSqlMapSessionMethod == null) {
            getLocalSqlMapSessionMethod = raw.getClass().getDeclaredMethod("getLocalSqlMapSession");
            getLocalSqlMapSessionMethod.setAccessible(true);
        }
        SqlMapSessionImpl sessionImpl = (SqlMapSessionImpl) getLocalSqlMapSessionMethod.invoke(raw);
        IbatisUtils.set(sessionImpl, this);
        return new SqlMapSessionWrapper(raw, sessionImpl);
    } catch (Exception e) {
        throw new IllegalStateException(e.getMessage(), e);
    }
}
Also used : BatchException(com.ibatis.sqlmap.engine.execution.BatchException) SQLException(java.sql.SQLException) SqlMapSessionImpl(com.ibatis.sqlmap.engine.impl.SqlMapSessionImpl)

Example 7 with SqlMapSessionImpl

use of com.ibatis.sqlmap.engine.impl.SqlMapSessionImpl in project druid by alibaba.

the class SqlMapSessionWrapperTest method test_wrap.

@SuppressWarnings("deprecation")
public void test_wrap() throws Exception {
    SqlMapClientImpl client = (SqlMapClientImpl) context.getBean("master-sqlMapClient");
    Assert.assertNotNull(client);
    SqlMapSessionImpl session = new SqlMapSessionImpl(client);
    SqlMapSessionWrapper wrapper = new SqlMapSessionWrapper(client, session);
    wrapper.startTransaction();
    wrapper.commitTransaction();
    wrapper.getDataSource();
    wrapper.getCurrentConnection();
    wrapper.getUserConnection();
    wrapper.close();
}
Also used : SqlMapClientImpl(com.ibatis.sqlmap.engine.impl.SqlMapClientImpl) SqlMapSessionWrapper(com.alibaba.druid.support.ibatis.SqlMapSessionWrapper) SqlMapSessionImpl(com.ibatis.sqlmap.engine.impl.SqlMapSessionImpl)

Example 8 with SqlMapSessionImpl

use of com.ibatis.sqlmap.engine.impl.SqlMapSessionImpl in project pinpoint by naver.

the class SqlMapSessionIT method methodCallWithNullSqlIdShouldOnlyTraceMethodName.

@Test
public void methodCallWithNullSqlIdShouldOnlyTraceMethodName() throws Exception {
    SqlMapSession sqlMapSession = new SqlMapSessionImpl(this.sqlMapClient);
    super.testAndVerifyInsertWithNullSqlId(sqlMapSession);
}
Also used : SqlMapSession(com.ibatis.sqlmap.client.SqlMapSession) SqlMapSessionImpl(com.ibatis.sqlmap.engine.impl.SqlMapSessionImpl) Test(org.junit.Test)

Example 9 with SqlMapSessionImpl

use of com.ibatis.sqlmap.engine.impl.SqlMapSessionImpl in project pinpoint by naver.

the class SqlMapSessionIT method deleteShouldBeTraced.

@Test
public void deleteShouldBeTraced() throws Exception {
    SqlMapSession sqlMapSession = new SqlMapSessionImpl(this.sqlMapClient);
    super.testAndVerifyDelete(sqlMapSession);
}
Also used : SqlMapSession(com.ibatis.sqlmap.client.SqlMapSession) SqlMapSessionImpl(com.ibatis.sqlmap.engine.impl.SqlMapSessionImpl) Test(org.junit.Test)

Example 10 with SqlMapSessionImpl

use of com.ibatis.sqlmap.engine.impl.SqlMapSessionImpl in project pinpoint by naver.

the class SqlMapSessionIT method queryForMapShouldBeTraced.

@Test
public void queryForMapShouldBeTraced() throws Exception {
    SqlMapSession sqlMapSession = new SqlMapSessionImpl(this.sqlMapClient);
    super.testAndVerifyQueryForMap(sqlMapSession);
}
Also used : SqlMapSession(com.ibatis.sqlmap.client.SqlMapSession) SqlMapSessionImpl(com.ibatis.sqlmap.engine.impl.SqlMapSessionImpl) Test(org.junit.Test)

Aggregations

SqlMapSessionImpl (com.ibatis.sqlmap.engine.impl.SqlMapSessionImpl)11 SqlMapSession (com.ibatis.sqlmap.client.SqlMapSession)8 Test (org.junit.Test)8 SqlMapSessionWrapper (com.alibaba.druid.support.ibatis.SqlMapSessionWrapper)1 BatchException (com.ibatis.sqlmap.engine.execution.BatchException)1 SqlMapClientImpl (com.ibatis.sqlmap.engine.impl.SqlMapClientImpl)1 SQLException (java.sql.SQLException)1