cayenne-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bruno René Santos <brunor...@holos.pt>
Subject Oracle Sequences & Cache
Date Thu, 16 Jun 2011 15:36:55 GMT
Hello all,

We had a problem on one of our applications on Oracle because, we think, 
of the cayenne cache and we wanted to have some sort of confirmation if 
we are seeing this correctly...

On Oracle, in order to get the next PK we need to execute the query:

Select sequence_name.next_val from DUAL

Sometimes the query logger did not print this command before an INSERT. 
After some testing we reached to the conclusion that this was a cache 
issue and so we overrode CommitChanges and CommitChangesToParent in 
order to clear the query cache after the commit phase, like this:

@Override
     public void commitChanges() throws CayenneRuntimeException {
         super.commitChanges();
         getQueryCache().clear();
     }

     @Override
     public void commitChangesToParent() {
         super.commitChangesToParent();
         getQueryCache().clear();
     }

We think this is a bug because on the PK generation phase on cayenne no 
data, always, should be ever retrieved from the cache, which would lead 
to repeated primary keys...

Can this be true?

Thanx
Bruno
-- 
Bruno René Santos | brunorene@holos.pt <mailto:brunorene@holos.pt> | 
Gestor de Projectos | Analista | Programador | Investigador

Holos - Soluções Avançadas em Tecnologias de Informação S.A.
Parque de Ciência e Tecnologia de Almada/Setúbal . Edifício Madan Parque
Rua dos Inventores . Quinta da Torre . 2825 - 182 Caparica . Portugal
Phone: +351 210 438 686 . Fax: +351 210 438 687 . Web: www.holos.pt


This email and any files transmitted with it are confidential and 
intended solely for the use of the individual or entity to whom they are 
addressed. If you are not the intended recipient or the person 
responsible for delivering the email to the intended recipient, be 
advised that you have received this email in error and that any use, 
dissemination, forwarding, printing, or copying of this email is 
strictly prohibited. If you have received this email in error please 
notify Bruno René Santos by telephone on +351 210 438 686


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message