Exemplo n.º 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;
        }
Exemplo n.º 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);
        }
Exemplo n.º 3
0
 public DelegatingSqlSessionFactory(SqlSessionFactory wrappSqlSessionFactory)
 {
     wrappedSessionFactory = wrappSqlSessionFactory;
 }
Exemplo n.º 4
0
 public StatementLogSqlSessionFactory(SqlSessionFactory wrappSqlSessionFactory) : base(wrappSqlSessionFactory)
 {
 }