VP & cache

Hi,
I’m developing a web application with VP, but some annoying problems occurring continuously.
Although I selected “disable cache” from cache options section, when I insert or modify a row in DB hibernate always give me a cached version of object.

How can I disable this cache?

Thanks

Maurizio
P.S.: I’m using VP Version 6.1 build 20070821e for linux

hi Maurizio,

The cache option is used for defined the second-level cache, which is used for cross-session. What hibernate provided is a first-level cache. It means that the loaded/saved object will be cached in the session.

In order to force the session to load an object from the database, you can using session.clear() or session.evict(object)

Best regards,
Jick

Hi Joy,
unfortunately it seems there is no clear under session of NHibernate (unlike hibernate)
is It the same thing if I use close rather than clear?

Thanks

Maurizio

Hi Maurizio,

I’ll discuss with our engineers and then get back to you asap.

Best regards,
Jick

Hi Maurizio,

We’ve added the Clear() method for session object. Please download the patch at:
http://files3.visual-paradigm.com/200708/Patch/6-1-0_20070830a/VP_Suite_Windows_3_1_20070830a.exe

Please install it by overwriting the current installation. Then, generate ORM code again. The generated code will have the problem fixed.

Best regards,
Jick

Hi Jick,
this time I have a clean conscience, I remembered to tell you that I’m using linux version :slight_smile: (see first post)

Could you send me a linux version?

Thanks in advance
Maurizio

Hi Maurizio,

Here is the Linux version:
http://files3.visual-paradigm.com/200708/Patch/6-1-0_20070830a/VP_Suite_Linux_3_1_20070830a.sh

Best regards,
Jick