public override void postInit(ProcessEngineConfigurationImpl processEngineConfiguration) { SqlSessionFactory sqlSessionFactory = processEngineConfiguration.SqlSessionFactory; // wrap the SqlSessionFactory using a statement logger StatementLogSqlSessionFactory wrappedSessionFactory = new StatementLogSqlSessionFactory(sqlSessionFactory); processEngineConfiguration.SqlSessionFactory = wrappedSessionFactory; // replace the sqlSessionFacorty used by the DbSqlSessionFactory as well DbSqlSessionFactory dbSqlSessionFactory = processEngineConfiguration.DbSqlSessionFactory; dbSqlSessionFactory.SqlSessionFactory = wrappedSessionFactory; }
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes: //ORIGINAL LINE: @Test public void shouldNotReuseCachedSqlSessionIfNotConfigured() public virtual void shouldNotReuseCachedSqlSessionIfNotConfigured() { //JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final': //ORIGINAL LINE: final TestEngineCfg cfg = new TestEngineCfg(); TestEngineCfg cfg = new TestEngineCfg(); SqlSessionFactory existingSessionFactory = mock(typeof(SqlSessionFactory)); // given ProcessEngineConfigurationImpl.cachedSqlSessionFactory = existingSessionFactory; // if cfg.initSqlSessionFactory(); // then assertSame(existingSessionFactory, ProcessEngineConfigurationImpl.cachedSqlSessionFactory); assertNotSame(existingSessionFactory, cfg.SqlSessionFactory); }
public DelegatingSqlSessionFactory(SqlSessionFactory wrappSqlSessionFactory) { wrappedSessionFactory = wrappSqlSessionFactory; }
public StatementLogSqlSessionFactory(SqlSessionFactory wrappSqlSessionFactory) : base(wrappSqlSessionFactory) { }