Can nHibernate retrieve manually modified data from the repository table? I also disabled the second level cache, but it looks like this (nhibernate) is sometimes fetched from the cache, and sometimes from the repository table.
There are two types of caches in nhibernate: session caches and second level caches. A session cache always caches the objects viewed by this session — how nhibernate knows which objects have been modified and which need to be saved. The second level cache that you disabled is below this. The information you see in the cache comes from the session cache.
, (, ), , , . SessionFactory , Session . , - .
, session.Clear() .
NHibernate OO . , , NH.
, "Foo", "Foo" "Id" "SomeProperty". "SomeProperty", "oldValue" "newValue", NH DB, Foos, SomeProperty = "newValue", DB Foos, . Foo NH "oldValue", Foo ( , 1- ).
NHibernate - StatelessSesion, DB. , NH, NH.
, , :
, ISession.Clear(), ISessionFactory , , .
, ISession.Clear()
, ISessionFactory , , .
, -, SELECT , , , .
, , ; nhibernate, , , , , .
Nhibernate - . . Icriterea (nhibernate) . Icriteria:
ICriteria criteria = session.CreateCriteria(typeof (xyzclass)); criteria.Add(Expression.Eq( "xyzclass", somestringto retreivedata)); criteria.SetCacheable(); .UniqueResult();
NHibernate , , , , , , .
, : - , ? , , , - , NHibernate, / .
.
But in the future, we could manually edit the data. I also set lazy to false for this table and commented on all the second level cache properties used in sleep mode. But even then, it returns me different values instead of the recently changed value. Sometimes it gives me an old meaning, and sometimes a new one, so it is not permanent.
Source: https://habr.com/ru/post/1697491/More articles:wrong telneting feedback key - solarisWhat is the best way to create a text file on a .net website? - .netHow to force two browser windows to use the same "session"? - browserStarteam 2005 COM API - starteamstreaming wav files - c ++Linux domain management solution? - linuxDecoding letters ('a' .. 'z') from a sequence of bits without waste - language-agnostichttps://translate.googleusercontent.com/translate_c?depth=1&pto=aue&rurl=translate.google.com&sl=ru&sp=nmt4&tl=en&u=https://fooobar.com/questions/1697494/how-long-would-it-take-to-setup-a-new-ci-repository&usg=ALkJrhiahE8rc5_HhOfG0MDMzS_TkW-j0QImpersonate a user in Asp.Net - asp.netVB.NET - application encountered user-defined breakpoint - vb.netAll Articles