コード例 #1
0
        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;
        }
コード例 #2
0
//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);
        }
コード例 #3
0
 public DelegatingSqlSessionFactory(SqlSessionFactory wrappSqlSessionFactory)
 {
     wrappedSessionFactory = wrappSqlSessionFactory;
 }
コード例 #4
0
 public StatementLogSqlSessionFactory(SqlSessionFactory wrappSqlSessionFactory) : base(wrappSqlSessionFactory)
 {
 }