Click here to Skip to main content
15,885,546 members
Articles / Desktop Programming / Win32

Considerations for caching in BizTalk

Rate me:
Please Sign up or sign in to vote.
4.60/5 (4 votes)
24 Mar 2009GPL314 min read 42.2K   211   11  
Covering common challenges and pitfalls in caching in BizTalk.
using System;
using System.Collections.Generic;
using System.Text;

namespace BizTalkCaching
{
	public class Cache3
	{
		private static Cache3 _instance = null;
		private Dictionary<int, int> _numbers = new Dictionary<int, int>();
		private static object _padlock = new object();

		public Dictionary<int, int> Numbers
		{
			get { return _numbers; }
		}

		private Cache3()
		{
			DataStoreSimulator store = new DataStoreSimulator();
			store.LoadCache(_numbers);														
		}

		public static Cache3 Instance
		{
			get
			{
				lock (_padlock)
				{
					if (_instance == null)
					{
						_instance = new Cache3();
					}
				}
				return _instance;
			}
		}
	}
}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The GNU General Public License (GPLv3)


Written By
Software Developer (Senior)
United Kingdom United Kingdom
An enthusiast developer...

Comments and Discussions