public static ISessionFactory CreateSessionFactory()
		{
			var provider = new SqlServerSessionFactoryProvider(ConfigurationManager.ConnectionStrings["myConnectionString"].ConnectionString, new[]
			{
				typeof (MySagaMap)
			});
			return provider.GetSessionFactory();
		}
Exemplo n.º 2
0
        public void Setup()
        {
            var provider =
                new SqlServerSessionFactoryProvider(
                    "Application Name=Burrows.Tests;Connect Timeout=30;Connection Lifetime=300;Database=Hydro;Server=.;Integrated Security=SSPI;",
                    new[]
            {
                typeof(ConcurrentSagaMap)
            });

            _sessionFactory = provider.GetSessionFactory();

            using (ISession session = _sessionFactory.OpenSession())
                using (ITransaction tx = session.BeginTransaction())
                {
                    session.Delete("from ConcurrentSaga cs");
                    session.Flush();
                    tx.Commit();
                }
        }
Exemplo n.º 3
0
        private static Action <ServiceBusConfigurator> Config()
        {
            return(sbc =>
            {
                sbc.UseLog4Net();
                sbc.UseRabbitMq();
                sbc.ReceiveFrom("rabbitmq://localhost/greeting_saga");



                var sessionFactory =
                    new SqlServerSessionFactoryProvider(
                        @"Data Source=.\SQLExpress;Initial Catalog=auctiondb;Integrated Security=True;Enlist=false",
                        new[] { typeof(AuctionSagaMap) }).GetSessionFactory();


                sbc.Subscribe(
                    subs => subs.Saga(new NHibernateSagaRepository <AuctionSaga>(sessionFactory)));
            });
        }
Exemplo n.º 4
0
        public void Setup()
        {
            var provider =
                new SqlServerSessionFactoryProvider(
                    "Application Name=MassTransit.Tests;Connect Timeout=30;Connection Lifetime=300;Database=Hydro;Server=.;Integrated Security=SSPI;",
                    new[]
                        {
                            typeof(ConcurrentSagaMap)
                        });

            _sessionFactory = provider.GetSessionFactory();

            using (ISession session = _sessionFactory.OpenSession())
            using (ITransaction tx = session.BeginTransaction())
            {
                session.Delete("from ConcurrentSaga cs");
                session.Flush();
                tx.Commit();
            }
        }