Example #1
0
        public void TransactionSync1()
        {
            var top = new SyncIJobChunk {
            }.Schedule(m_Manager.UniversalQuery);

            Assert.Throws <InvalidOperationException>(() =>
            {
                // Cant run exclusive transaction while ijob chunk is running
                var exclusive = m_Manager.BeginExclusiveEntityTransaction();
                var middle    = new SyncMiddleJob {
                    Txn = exclusive
                }.Schedule(top);
            });
            top.Complete();
        }
Example #2
0
        public void TransactionSync2()
        {
            var exclusive = m_Manager.BeginExclusiveEntityTransaction();
            var middle = new SyncMiddleJob {
                Txn = exclusive
            }.Schedule();

            Assert.Throws <InvalidOperationException>(() =>
            {
                // job wasn't registered & thus couldn't be synced
                m_Manager.EndExclusiveEntityTransaction();
                new SyncIJobChunk {
                }.Schedule(m_Manager.UniversalQuery).Complete();
            });
            middle.Complete();
        }