Hi,
    Thank you Mahler for your fast reply.
    I understand that it is not possible to do it with the current OJB API.
    I am asking you this because I need to remove from OJB cache the objects
touched by a transaction when it is aborted.
    Here is what I think could be a good idea to fix this issue: as noted in
the OJB cache documentation (http://db.apache.org/ojb/objectcache.html), the
OJB user must manually remove each object touched by the trasaction when
using ObjectCacheDefaultImpl and the transaction is aborted because the
objects may be corrupted. So why doesn't the implementation of the
Transaction.abort method removes the touched objets from the cache? I think
this should fix this issue, don't you?
    Well, it's just an idea. In my system I am going to remove the objects
from cache manually, but as there's no way to get only the objects touched
by the transaction I'll have to clear the entire cache.

Thanks,
Jair Jr

----- Original Message -----
From: "Mahler Thomas" <[EMAIL PROTECTED]>
To: "'OJB Users List'" <[EMAIL PROTECTED]>
Sent: Tuesday, October 28, 2003 1:45 PM
Subject: RE: how to get objects locked by a transaction?


> Hello Jair,
>
> OJB ODMG stores each registered Objects in an o.a.ojb.odmg.ObjectEnvelope.
> All ObjectEnvelopes are kept in an o.a.ojb.odmg.ObjectEnvelopeTable.
> ObjectEnvelopeTable has a public method
> public Enumeration elements();
>
> which returns an Enumeration of all ObjectEnvelopes.
>
> The each OJB ODMG TransactionImpl maintains its own ObjectEnvelopeTable:
>     /**
>      * the internal table containing all Objects "touched" by this tx and
> their
>      * respective transactional state
>      */
>     private ObjectEnvelopeTable objectEnvelopeTable = null;
>
> Currently TransactionImpl does not provide public access to the
> ObjectEnvelopeTable.
> So I don't see a way to perform your task without changing OJB code...
>
> cheers,
> Thomas
>
> > -----Original Message-----
> > From: Jair da Silva Ferreira J�nior [mailto:[EMAIL PROTECTED]
> > Sent: Tuesday, October 28, 2003 12:25 AM
> > To: OJB Users List
> > Subject: how to get objects locked by a transaction?
> >
> >
> > Hello,
> >     How can I safely get all objects locked by a transaction
> > using ODMG or broker API?
> >     I need this because I want to remove all objects locked
> > by a transaction from the cache. Something like this:
> >
> >         .....
> >         Iterator lockedObjects=getLockedObjects(transaction);
> >         while(lockedObjects.hasNext()){
> >             broker.removeFromCache(lockedObjects.next());
> >         }
> >         .....
> >
> > Thanks,
> >     Jair Jr
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
>



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

Reply via email to