Hi Jair Jr,

hmm, this should not happend. Do you use checkpoint() or flush()
in your code?
This only could happens when the object was already in DB. Only the PersistenceBrokerImpl and RsIterator class push objects to cache.
If you abort the tx, the PB instance is not aware of locked objects.


Interesting problem, please let me know if you can reproduce it.

regards,
Armin

Jair da Silva Ferreira Júnior wrote:

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




--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to