enterprise-library

Microsoft Enterprise Library Caching Application Block not thread safe?

爱⌒轻易说出口 提交于 2019-12-10 15:39:23
问题 I created a super simple console app to test out the Enterprise Library Caching Application Block, and the behavior is baffling. I'm hoping I screwed something that's easy to fix in the setup. I have each item expire after 5 seconds for testing purposes. Basic setup -- "Every second pick a number between 0 and 2. If the cache doesn't already have it, put it in there -- otherwise just grab it from the cache. Do this inside a LOCK statement to ensure thread safety. APP.CONFIG: <configuration>

Compare Logging Application Block in Enterprise Library versus Log4net?

流过昼夜 提交于 2019-12-10 14:17:07
问题 Can somebody please compare these two logging mechanism? 回答1: This has been written about quite a bit. Here are some things to read: http://james.newtonking.com/archive/2007/06/05/enterprise-library-logging-vs-log4net.aspx http://theiterator.com/2009/01/log4net-vs-enterprise-library-logging-application-block/ https://stackoverflow.com/questions/118047/log4net-vs-enterprise-library-which-is-better-faster My thoughts: The general consensus seems to be that log4net performs faster. Whether this

.Net 3.5 Dll's in a .Net 4.0 application any issues

≡放荡痞女 提交于 2019-12-10 13:45:52
问题 We are planning to move a legacy application which uses enterprise library 4.1 which uses .Net 3.5 in a .Net 4.0 web application. We are wondering will this cause any performance problems? Will the .net 3.5 code run in a different application pool? 回答1: I have finally found answer to this. The performance problem I previously mentioned my team discovered is due to something else. Not loading .NET 3.5 on .NET 4.0 App Domain. Reading this article: http://msdn.microsoft.com/en-us/magazine

Max pool size was reached error for parallel connections

▼魔方 西西 提交于 2019-12-10 12:26:55
问题 I have a sql database and I am using Microsoft.Practices.EnterpriseLibrary for db communication. I have a database provider class as below: public class DBProvider { #region Properties #region Database /// <summary> /// The db instance. /// </summary> private Database database; #region Ctors /// <summary> /// Initializes a new instance of the <see cref="DBProvider"/> class. /// </summary> public DBProvider() { DatabaseProviderFactory dbProvider = new DatabaseProviderFactory(); database =

Monitoring Enterprise Library caching

岁酱吖の 提交于 2019-12-10 12:11:00
问题 I want to monitor the key names and values that are being stored by my application in the Enterprise Library caching mechanism. We're using the in memory settings. Basically, I just need to figure out how to dump the keys that are currently stored. I see that the ICacheManager returns an object that has a counter, but there doesn't appear to be a way to access the cached items unless you already know the key. Ideas? 回答1: You are correct - Enterprise Lib does not expose the in memory Cache of

How can I log both the Request.InputStream and Response.OutputStream traffic in my ASP.NET MVC3 Application for specific Actions?

北城余情 提交于 2019-12-10 12:04:47
问题 For a specific set of Actions I am required to log the incoming Requests InputStream as well as the outgoing Response.OutputStream. I envision using an ActionFilterAttribute for this and overriding the OnActionExecuted and OnResultExecuted methods. So I'm starting with this idea... public class ActionLoggerAttribute : ActionFilterAttribute { public override void OnActionExecuted(ActionExecutedContext filterContext) { base.OnActionExecuted(filterContext); HttpRequestBase request =

custom DB logging using enterprise library 4.1

风格不统一 提交于 2019-12-10 11:48:56
问题 We have to create a historical log of all the changed entities. we have defined our custom tables for this purpose. I have to incorporate this tables in Enterprise library logging block and do logging in these tables. I need to write a SP to insert values to these tables. Till now,what i have got from google is that i have to create a listener inheriting from CustomTraceListener and give my implementation of WriteMessage. What i need to know is,how will i plug my tables and SP in Enterprise

Using Enterprise Library's ExecuteSprocAccessor method with generics

余生颓废 提交于 2019-12-10 11:48:49
问题 I am trying to use one class to handle all of my CRUD on the database by using the ExecuteSprocAccessor method of the .NET Enterprise Library with generics. In my data layer, I was trying something like this: public static class CRUDDatabase { private static Database db = DatabaseFactory.CreateDatabase("ITS"); public static T SelectSingle<T>(string sprocName, int id) { return db.ExecuteSprocAccessor<T>(sprocName, id).First(); } } However, I get a build error on the return line in the

Enterprise Library Strong Naming Guidance Package

╄→尐↘猪︶ㄣ 提交于 2019-12-10 10:33:27
问题 For the life of me I can not find the Enterprise Library Strong Naming Guidance Package download for Enterprise Library 4.1 I need this to sign the assemblies to add them to the GAC. Does anybody know where I can find it? I can't find it anywhere on the www.codeplex.com/entlib or www.codeplex.com/entlibcontrib websites. HELP! 回答1: According to this, the shipped binaries are already strong named, so you should be good to go. EDIT: If you modified the source, use this guide. 回答2: The guidance

Enterprise library caching parameters on stored procs?

谁说我不能喝 提交于 2019-12-10 10:04:20
问题 I'm trying to standardise some data access code with my colleagues. One of the aforementioned colleagues asserts that the EntLib Data Access Block trys to cache parameters on stored proc calls. I've had a look in reflector and there is some evidence that it could be caching them. But I don't think it does in the following situation. public Dictionary<long, string> GetQueue(int maxItems) { var sq = new SqlDatabase(_connString.ConnectionString); var result = new Dictionary<long, string>();