I am encountering a problem with Hibernate when the data is updated from the external tools, updated data is not getting effected in the application.
when the Server (JBoss) is started logger information in the console of the eclipse IDE is "Second Level Cache:enabled".
> But according to the Documentation of Hibernate "Cache doesn't get enabled untill it is explicitly declared to enable".
> I have checked the following scenarios
> 1.Changed data from my sql client browser and accesed through the application data is same as before(no updated data is present).
> 2 I have checked whether Hibernate is establishing connection with the database everytime a request is sent .For this I have interrupted the connection.I got "Socket Exception" which means it is establishing connection with the database everytime a request is sent.
> 3.One more strange thing is "Once our database server was re-started while I am working",still I am able to view all the data'which means Hibernate is using the data which is present in the Cache(which is a contradiction to scenario 2).
> 4.I am able to view the updated data once the server is re-started.
> After all these testings I have come to a conclusion that "Hibernate is using the second-level cache to retrieve data ,which is a contradiction to the Hibernate's documentation "cache is enabled only if it explicitly enalbed".
> As the Eclipse is enabling the cache explicitly,I need to disable the second level cache in my application.Did any one face this problem ,if so please provide me with some solution.
> Thanks in advance.
> Divya
|