-->
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 Cache
PostPosted: Thu Mar 11, 2004 11:25 am 
Beginner
Beginner

Joined: Mon Sep 15, 2003 9:10 am
Posts: 43
Hi,

i hava a new question :

This is my fonction :

public List getUtilisateurs() throws DAOException {
List liste=null;

Session session=getSession();

try {
Transaction tx=session.beginTransaction();
liste=session.find("from Utilisateur u order by upper(u.nom)");
tx.commit();
} catch (HibernateException e) {
}finally{
closeSession();
}
return liste;
}


My question : Is the return list totaly independent of the hibernate cache or must i create copy.

Thanks,

Fabien.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Mar 11, 2004 11:30 am 
Hibernate Team
Hibernate Team

Joined: Thu Dec 18, 2003 9:55 am
Posts: 1977
Location: France
all you get from the session is "linked" to it.
Be carefull with copying instance of persistant objects.

You must understand that session must not be considered as a real cache since no other thread can access it (if your code is ok).


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.