-->
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.  [ 1 post ] 
Author Message
 Post subject: Prevalence Cache - winforms
PostPosted: Wed Mar 25, 2009 6:25 pm 
Newbie

Joined: Wed Mar 25, 2009 3:29 pm
Posts: 1
NHibernate 2.0:

The code that I am executing is for example:

ICriteria criteria = Session.CreateCriteria(typeof(User));
criteria.Add(Expression.Eq("UserName", userName));
criteria.SetCacheable(true);
return criteria.UniqueResult<User>();


After closing the application, instantiation of NHibernate throws an error:
"Key cannot be null.\r\nParameter name: key", and from the log4net output, I deduce it is when the cache is loaded the old session is tried to be called (the uuid is copied from previous run).

2009-03-25 19:15:26.312 [10] DEBUG NHibernate.Caches.Prevalence.PrevalenceCacheProvider - configuring cache in C:\MyApp\bin\Debug\cache.
2009-03-25 19:15:26,375 [10] WARN NHibernate.Impl.SessionFactoryObjectFactory [(null)] - Not found: cb05d7fec9ad45709d3ebbc92b9982fc

Also this number is inside the files in the cache directory (in a serialized session object apparently, for each serialized ICriteria):

0003da0: 0000 0100 0000 050c 0000 0022 4e48 6962 ..........."NHib
0003db0: 6572 6e61 7465 2e49 6d70 6c2e 5365 7373 ernate.Impl.Sess
0003dc0: 696f 6e46 6163 746f 7279 496d 706c 0300 ionFactoryImpl..
0003dd0: 0000 046e 616d 6504 7575 6964 0864 6973 ...name.uuid.dis
0003de0: 706f 7365 6401 0100 0108 0000 000a 0611 posed...........
0003df0: 0000 0020 6362 3035 6437 6665 6339 6164 ... cb05d7fec9ad
0003e00: 3435 3730 3964 3365 6262 6339 3262 3939 45709d3ebbc92b99
0003e10: 3832 6663 0005 0d00 0000 1f4e 4869 6265 82fc.......NHibe

Is this a problem of the cache implementation? or because the NHibernate way it is using the cache or serializes the object?


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

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.