Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. Help: NHibernate and SysCache2 [modified]

Help: NHibernate and SysCache2 [modified]

Scheduled Pinned Locked Moved C#
databasequestioncsharpasp-netsysadmin
1 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • E Offline
    E Offline
    emiaj
    wrote on last edited by
    #1

    Hi there, i want to know how to setup to nhibernate for use the SysCache2 in my AspNet 2.0 Application... this is what i have been doing, in the web.config:

    NHibernate.Dialect.MsSql2005Dialect NHibernate.Connection.DriverConnectionProvider server=XXXX;database=XXXX;uid=XXXX;password=XXXX;Max Pool Size=100;Enlist=False true true NHibernate.Caches.SysCache2.SysCacheProvider,NHibernate.Caches.SysCache2 And in my class i do the following: public static IList GetCountryList() { string sql = "from Model.Country c Order By c.Countryid"; IQuery query = Base.Session().CreateQuery(sql); query.SetCacheable(true).SetCacheRegion("nhibernate.country.countrylist"); IDictionaryEnumerator e = HttpContext.Current.Cache.GetEnumerator(); while (e.MoveNext()) { //The first time nothing happen here //After that the System.Web.HttpContext.Current.Cache.Count is 2 //How can i get the cached collection?? object o = e.Current; object k = e.Key; object v = e.Value; } return query.List(); } Any help would be appreciated. Bye. p.d:oops, its the c# forum, my code was in vb net, now is in the right language :) -- modified at 18:32 Tuesday 2nd October, 2007

    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • World
    • Users
    • Groups