Click here to Skip to main content
15,880,651 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.1K   211   11  
Covering common challenges and pitfalls in caching in BizTalk.
using System;
using System.Collections.Generic;
using System.Text;

namespace BizTalkCaching
{
	public class Cache25
	{
		private static Cache25 _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 Cache25()
		{
			DataStoreSimulator store = new DataStoreSimulator();
			store.LoadCache(_numbers);
		}

		public static Cache25 Instance
		{
			get
			{
				if (_instance == null)
				{
					lock (_padlock)
					{
						_instance = new Cache25();
					}
				}
				return Cache25._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