db-ojb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Alessandro Colantoni" <acolant...@brujulatelecom.com>
Subject RV: org.apache.ojb.broker.OptimisticLockException: Object has been modified by someone else
Date Tue, 10 Aug 2004 15:15:55 GMT
 
 
-----Mensaje original-----
De: Alessandro Colantoni [mailto:acolantoni@brujulatelecom.com] 
Enviado el: martes, 10 de agosto de 2004 17:12
Para: 'ojb-user-subscribe@db.apache.org'
Asunto: org.apache.ojb.broker.OptimisticLockException: Object has been
modified by someone else
 
Hi,
I'm trying to use ObjectCacheOSCacheImpl just for a table.
I specified just in the class descriptor where to get the implementation
of the cache and I followed all the steps in the HOW-TO document.
I left the Empty implementation of the cache in the ojb.properties.
Than I have a method findByPrimaryKey that search a record of my table
CASO
 
broker = ServiceLocator.getInstance().findBroker();
criteria.addEqualTo("IDCASO", new Integer(primaryKey));
Query query=QueryFactory.newQuery(CASOVO.class, criteria);
cASOVO = (CASOVO) broker.getObjectByQuery(query);
 
Ojb look for datas in the cache because it doesn't see changes done
manually in the dB
 
Than I have a method to update the table
 
CASOVO cASOVO = (CASOVO) insertRecord;
broker = ServiceLocator.getInstance().findBroker();
broker.beginTransaction();
broker.store(cASOVO);
broker.commitTransaction();
 
In the line of the store I get the error
org.apache.ojb.broker.OptimisticLockException: Object has been modified
by someone else
 
 
What's wrong?

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