-->
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: I WANT TO DISABLE ALL CACHES
PostPosted: Thu Sep 21, 2006 11:42 am 
Beginner
Beginner

Joined: Tue Aug 29, 2006 8:13 pm
Posts: 32
Location: Spain (GU)
Hi,

How can I disable all caches?

My system is collaborative and caches are really problematic and confusing in this kind of system.

Thanks in advance,

Best regards.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Sep 21, 2006 1:06 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
hibernate doesn't enable any second level cache unless you tell it to - so don't.

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Fri Sep 22, 2006 3:15 am 
Beginner
Beginner

Joined: Tue Aug 29, 2006 8:13 pm
Posts: 32
Location: Spain (GU)
But, when I insert or update a row and I start up the application from other computer, I can't see the last changes. Can it be caused for transactions not completed? For example, in the code below, the line highlighted cause the next Exception: Transaction not successfully started

DocumentDAO documentDAO=(DocumentDAO)DocumentDAO.getInstance();
Session s=documentDAO.getSession();

Transaction tx=documentDAO.beginTransaction(s);

Document docu=documentDAO.get(new Integer(idDocument));

SecurityClasDAO securityClasDAO=(SecurityClasDAO)SecurityClasDAO.getInstance();
Session s3=securityClasDAO.getSession();

Transaction tx3=securityClasDAO.beginTransaction(s3);

SecurityClas secClas=(SecurityClas)securityClasDAO.getQuery("from SecurityClas s where s.value=?",s3).setCacheable(false).setString(0, clasiSeg).list().get(0);

securityClasDAO.commitTransaction(tx3);
securityClasDAO.closeSession(s3);


TypeParagraphDAO typeParagraphDAO=(TypeParagraphDAO)TypeParagraphDAO.getInstance();
Session s4=typeParagraphDAO.getSession();

Transaction tx4=typeParagraphDAO.beginTransaction(s4);

TypeParagraph typeParagraph=(TypeParagraph)typeParagraphDAO. getQuery("from TypeParagraph t where t.value=?",s4).setCacheable(false).setString(0, tipo).list().get(0);
System.out.println("TIPO DE PARRAFO:"+typeParagraph.getValue());

typeParagraphDAO.commitTransaction(tx4);
typeParagraphDAO.closeSession(s4);

Paragraph parrafo=new Paragraph();
parrafo.setContent(contenido);
parrafo.setCreationDate(new Date());
parrafo.setDeleted(false);
parrafo.setIdDocument(docu);
parrafo.setIdParentNode(new Long(ppid));
parrafo.setIdSecurityclas(secClas);
parrafo.setIdType(typeParagraph);
parrafo.setLevel("level");
parrafo.setLock(locked);
parrafo.setModificationDate(new Date());
parrafo.setOwner(owner);
parrafo.setTitle(titulo);


ParagraphDAO paragraphDAO=(ParagraphDAO)ParagraphDAO.getInstance();
Session s2=paragraphDAO.getSession();

Transaction tx2=paragraphDAO.beginTransaction(s2);

Integer idNuevoParrafo=paragraphDAO.save(parrafo);
System.out.println("PARRAFO GUARDADO OK");

paragraphDAO.commitTransaction(tx2);
paragraphDAO.closeSession(s2);

if(docu==null)
{
System.out.println("RETURN NULL");
return null;
}
else if(docu.getName().equals(""))
{
resul=idNuevoParrafo.toString();
}
else
{
String nuevoDocumento=annadeParrafoAlXML(docu.getName(),idNuevoParrafo,titulo,ppid,"",tipo, locked, contenido, clasiSeg);
docu.setName(nuevoDocumento);
documentDAO.saveOrUpdate(docu);
resul=idNuevoParrafo.toString();
}
}
catch(Exception e)
{
System.out.println("Error en el Servicio de addParagraph--> "+e.getMessage());
return null;
}


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.