Click here to Skip to main content
15,889,116 members
Home / Discussions / ASP.NET
   

ASP.NET

 
AnswerRe: (Input string was not in a correct format) with ExecuteReader Pin
Parthi Bun10-Aug-12 3:06
Parthi Bun10-Aug-12 3:06 
AnswerRe: (Input string was not in a correct format) with ExecuteReader Pin
StianSandberg10-Aug-12 3:26
StianSandberg10-Aug-12 3:26 
GeneralRe: (Input string was not in a correct format) with ExecuteReader Pin
Jassim Rahma10-Aug-12 4:03
Jassim Rahma10-Aug-12 4:03 
GeneralRe: (Input string was not in a correct format) with ExecuteReader Pin
Jassim Rahma11-Aug-12 9:11
Jassim Rahma11-Aug-12 9:11 
AnswerRe: (Input string was not in a correct format) with ExecuteReader Pin
Shameel14-Aug-12 0:46
professionalShameel14-Aug-12 0:46 
Questionasp.net Pin
Rajesh.paka10-Aug-12 2:08
Rajesh.paka10-Aug-12 2:08 
AnswerRe: asp.net Pin
Wes Aday10-Aug-12 4:00
professionalWes Aday10-Aug-12 4:00 
Questionstrange issue with cache application block (ENT LIB 5) Pin
Luca Dominici9-Aug-12 23:23
Luca Dominici9-Aug-12 23:23 
Hi all, I am relatively new to Caching application block, so my problem can be very trivial. But I don't get it.

So there is this complex application (in production enviroment) that I have rewritten to use cache.

my framework is not so easy to describe, however: every service class (in the logic tier) has a father class that define the cache (static, so application wide)

SmallObjectCache = EnterpriseLibraryContainer.Current.GetInstance<ICacheManager>("SmallObjectCache");


I have written some classes to manage my cache: I use for single objects and for list of object (Read operation and GetAll operation)

C#
protected virtual void CacheAddData(DomainObject domainObject)
{
    if (domainObject != null)
    {
        CacheDictionary[this.GetType().FullName].Add(this.GetType().FullName + "_" + domainObject.GetId(), domainObject);

        List<DomainObject> cachedObj = CacheGetAllData();
        if (cachedObj != null && cachedObj.Count > 0)
        {
            int idx = -1;
            try
            {
                idx = cachedObj.FindIndex(a => a.GetId() == domainObject.GetId());
                cachedObj.RemoveAll(a => a.GetId() == domainObject.GetId());
            }
            catch (NullReferenceException)
            {
                BusinessFacade.ApplicationLogger.Write("INFO: Cache: Linq exception", Category.General, Priority.Normal, 1, System.Diagnostics.TraceEventType.Information);
            }

            if (idx >= 0)
                cachedObj.Insert(idx, domainObject);
            else
                cachedObj.Add(domainObject);
            CacheAddAllData(cachedObj);
        }
    }
}


So what the above do is to add an item in cache and if exist a list of that objects retrive it and add/insert in the right position the item.

Now the bug:
Everything is running fine. 100+ people use the system without a glitch. BUT sometime, near middle of the day, one or two people report a nullreference exception, especially in this code:

List<Utente> decoratori = GetAll().Cast<Utente>().ToList().Where<Utente>(u => u.Ruolo.IsDecoratore()).ToList();


the where iterator crash stating that object is null (I do checks before the only null objects can be the "Ruolo")

Now this is the issue: the same user with everyting unchanged became without an attribute (non deterministic).

Recycling the IIS memory fix the issue (so is not a reproducible issue).

I can't debug the issue because on my develop machine I have not this issue, bu I am one user and do same stuff.

BTW the application call garbage collection explicity very often , I don't know if this can be an issue.

I am becaming crazy (users complain a lot, as you can imagine...)
AnswerRe: strange issue with cache application block (ENT LIB 5) Pin
Pete O'Hanlon10-Aug-12 0:42
mvePete O'Hanlon10-Aug-12 0:42 
AnswerRe: strange issue with cache application block (ENT LIB 5) Pin
jkirkerx10-Aug-12 10:12
professionaljkirkerx10-Aug-12 10:12 
Questiondebug javascript Pin
dcof9-Aug-12 18:44
dcof9-Aug-12 18:44 
AnswerRe: debug javascript Pin
AnnieCalvert9-Aug-12 20:09
AnnieCalvert9-Aug-12 20:09 
GeneralRe: debug javascript Pin
dcof10-Aug-12 4:31
dcof10-Aug-12 4:31 
GeneralRe: debug javascript Pin
enhzflep10-Aug-12 4:59
enhzflep10-Aug-12 4:59 
Generalwindow open Pin
dcof9-Aug-12 12:16
dcof9-Aug-12 12:16 
QuestionRe: window open Pin
CodeHawkz9-Aug-12 20:57
CodeHawkz9-Aug-12 20:57 
AnswerRe: window open Pin
dcof10-Aug-12 4:30
dcof10-Aug-12 4:30 
GeneralRe: window open Pin
CodeHawkz12-Aug-12 8:36
CodeHawkz12-Aug-12 8:36 
GeneralRe: window open Pin
jkirkerx10-Aug-12 11:33
professionaljkirkerx10-Aug-12 11:33 
GeneralRe: window open Pin
dcof11-Aug-12 11:45
dcof11-Aug-12 11:45 
GeneralRe: window open Pin
jkirkerx11-Aug-12 13:34
professionaljkirkerx11-Aug-12 13:34 
Generaltextbox wrap to several lines Pin
classy_dog9-Aug-12 9:05
classy_dog9-Aug-12 9:05 
AnswerRe: textbox wrap to several lines Pin
R. Giskard Reventlov9-Aug-12 10:02
R. Giskard Reventlov9-Aug-12 10:02 
GeneralRe: textbox wrap to several lines Pin
classy_dog9-Aug-12 12:07
classy_dog9-Aug-12 12:07 
AnswerRe: textbox wrap to several lines Pin
R. Giskard Reventlov9-Aug-12 12:40
R. Giskard Reventlov9-Aug-12 12:40 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.