-->
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.  [ 2 posts ] 
Author Message
 Post subject: Hibernate does not always recognize changes to the database
PostPosted: Mon Jul 02, 2007 1:09 pm 
Newbie

Joined: Mon Jul 02, 2007 12:43 pm
Posts: 1
I have an application running on Jboss and using spring and hibernate. Some of these tables have configuration data for the application and we change this data using an external tool.

Sometimes the application recognizes these changes and sometimes it doesn't.

My question is: If I make data changes using an external tool, should or can hibernate recognize these changes or do I need to re-start the application?

Thanks,
Dennis


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jul 03, 2007 1:41 am 
Regular
Regular

Joined: Mon Mar 26, 2007 12:38 am
Posts: 119
Hi,
>>> If I make data changes using an external tool, should or can hibernate recognize these changes

As far as I understand,
it is not possible for Hibernate ( or any ORM tool ) to recognize changes made to the database by an external entity in real time.
Hibernate doesn't poll the database to see if some objects are modified just to pull them up immediately.
It is not practically viable to do so.

>>> do I need to re-start the application?
Not really.
Bypass the cache!
i) clear the session. ( might be a costly affair )
ii) session.refresh(object) ( if you know which object to refresh )

You can also have a look at,
i) Hibernate LockModes
ii) Generated and Default Property Values

They address similar issues.

--------------------------------------------
Rate the reply if you find it helpful


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

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.