These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 posts ] 
Author Message
 Post subject: SysCache - Query Cache thread safeness.
PostPosted: Thu Jul 06, 2006 9:29 pm 
Newbie

Joined: Sat Jun 11, 2005 1:56 am
Posts: 19
Hi All,

Just a quick question. I am using the SysCacheProvider with Query Caching turned on. This is for an ASP.Net app. If 2 or more requests come in with the same query (Press F5 a couple of times) then I get this exception (From NHibernate Logs).

2006-07-07 11:05:28,888 INFO NHibernate.Loader.Loader - [VERY LONG QUERY]
2006-07-07 11:05:28,888 INFO NHibernate.Loader.Loader - [VERY LONG QUERY]
2006-07-07 11:05:28,888 INFO NHibernate.Loader.Loader - [VERY LONG QUERY]
2006-07-07 11:05:28,888 INFO NHibernate.Loader.Loader - [VERY LONG QUERY]
2006-07-07 11:05:28,904 WARN NHibernate.Util.ADOExceptionReporter - System.ArgumentException: Item has already been added. Key in dictionary: "NHibernate-Cache:NHibernate.Cache.StandardQueryCache:sql: [VERY LONG QUERY]
at System.Collections.Hashtable.Insert(Object key, Object nvalue, Boolean add)
at System.Collections.Hashtable.Add(Object key, Object value)
at NHibernate.Caches.SysCache.SysCache.Put(Object key, Object value)
at NHibernate.Cache.StandardQueryCache.Put(QueryKey key, IType[] returnTypes, IList result, ISessionImplementor session)
at NHibernate.Loader.Loader.List(ISessionImplementor session, QueryParameters queryParameters, ISet querySpaces, IType[] resultTypes)
at NHibernate.Loader.CriteriaLoader.List(ISessionImplementor session)
at NHibernate.Impl.SessionImpl.Find(CriteriaImpl criteria)
2006-07-07 11:05:28,904 INFO NHibernate.Loader.Loader - [VERY LONG QUERY]
2006-07-07 11:05:28,904 ERROR NHibernate.Util.ADOExceptionReporter - Item has already been added. Key in dictionary: "NHibernate-Cache:NHibernate.Cache.StandardQueryCache:sql: [VERY LONG QUERY]


Is there any information available on this? Is this a bug? Is Query Caching stable? Do I have to implement my own locking on top of
NHibernate (if using cache)? That seems like an inefficient solution.

Cheers

Guido Tapia

Hibernate version: 1.0.2
Name and version of the database you are using:SQL Server 2000


Top
 Profile  
 
 Post subject:
PostPosted: Thu Nov 02, 2006 1:43 am 
Senior
Senior

Joined: Sat Sep 03, 2005 12:54 am
Posts: 139
Hi,

I have also seen this error occasionally and am not sure if there is an issue with the Cache provider (unlikely) or something that I am doing wrong (very likely).

Any tips on how to track down the cause of this error or any best practices for using the SysCache?

Thanks,

Jason


Top
 Profile  
 
 Post subject:
PostPosted: Thu Nov 02, 2006 3:35 pm 
Contributor
Contributor

Joined: Thu May 12, 2005 8:45 am
Posts: 226
Do you get the same error with other caches?


Top
 Profile  
 
 Post subject:
PostPosted: Fri Nov 03, 2006 11:15 pm 
Senior
Senior

Joined: Sat Sep 03, 2005 12:54 am
Posts: 139
Thanks k-dub...I notice that Sergey has responded in another thread to say that this will be fixed in 1.0.3. I haven't tried with the other caches and will wait to try out 1.0.3 first.

Cheers,

Jason


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.