-->
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.  [ 3 posts ] 
Author Message
 Post subject: Handling database update outside of Hibernate
PostPosted: Fri Aug 12, 2005 1:12 am 
Newbie

Joined: Fri Aug 12, 2005 1:08 am
Posts: 1
I'm using Hibernate 3.0 and I'm trying to figure out exactly what I need to configure to permit the following:

1) Have a user, through hibernate, update and commit changes
2) Have a user, not through hibernate access those changes directly in the database and make changes
3) Have the hibernate user be able to view the updates that the non-hibernate user made

What I find right now, using MySQL, is that if I access the database from hibernate, and load a piece of data, the data never seems to refresh against the database. I'm running a query and the calling the list() method to get the object I'm referencing.

Any suggestions on what I need to do to force Hibernate to check the database when it loads an object?


Top
 Profile  
 
 Post subject:
PostPosted: Fri Aug 12, 2005 1:41 am 
Regular
Regular

Joined: Thu May 26, 2005 2:08 pm
Posts: 99
Please fill out all of these fields that you deleted. Otherwise, we're just guessing what your code does.


Quote:
Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp

Hibernate version:

Mapping documents:

Code between sessionFactory.openSession() and session.close():

Full stack trace of any exception that occurs:

Name and version of the database you are using:

The generated SQL (show_sql=true):

Debug level Hibernate log excerpt:


Top
 Profile  
 
 Post subject:
PostPosted: Fri Aug 12, 2005 2:37 am 
Expert
Expert

Joined: Thu Sep 04, 2003 8:23 am
Posts: 368
With your use case there is only one problem with second level cache. If you update the db outside hibernate it will be difficult to use the second level cache.

Also note that a session is a unit of work. It is often equals to a transaction. So if you open your session before you do your update outside hibernate, depending on your isolation level you may not see the changes you made in another transaction.

If this is not your problem, send a snippet code that show syntacticaly what you want to do

_________________
Seb
(Please don't forget to give credits if you found this answer useful :)


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 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.