Hi,
    I am using ojb1.0_rc5, ODMG api with OJB queries, mysql4 (innodb tables) in Linux 
Red Hat 7.3 (kernel 2.4.20-20.7).
    I moved from rc4 to rc5 recently and I noticed that sometimes the objects 
persisted inside an aborted transaction are still in cache when another transaction is 
started. Please, take a look at the above code to better undestand what I am saying:

   Transaction t=implementation.newTransaction();
   t.begin();
   Person e=new Person();
   t.lock(e,t.WRITE);
   e.setName("some exam");
    t.abort();   
   
    t=implementation.newTransaction();
   t.begin();   
    PersistenceBroker broker=((HasBroker)t).getBroker();
   QueryByIdentity query=new QueryByIdentity(e);
   Person loaded=(Person)broker.getObjectByQuery(query);
   boolean cacheOk=(loaded==null); //here cacheOk==false sometimes
   t.commit();


    This problem does not happen everytime. So, sometimes cacheOk==true.
    I wasn't able to reproduce this problem in a test case, but it does happen 
sometimes.

    This problem has never happened when I used rc4. 

    Here's my cache configuration in OJB.properties:

        ObjectCacheClass=org.apache.ojb.broker.cache.ObjectCacheDefaultImpl
        descriptorBasedCaches=false

Thanks,
    Jair Jr

Reply via email to