Hi,

----- Original Message -----
From: "jean-pierre lerbscher" <[EMAIL PROTECTED]>
To: "OJB Users List" <[EMAIL PROTECTED]>
Sent: Tuesday, September 23, 2003 10:38 AM
Subject: Re: Problem : stale data when jta transaction rollback


> Hi Armin,
> Could could explain to me in detail what happen in odmg or broker
layer
> when the jta transaction rollback ?
>
in odmg-layer we use javax.transaction.Synchronization
to commit/abort intern odmg tx (see J2EETransactionImpl).
On rollback/abort all dirty objects are removed from
cache to avoid dirty-reads. See
ObjectEnvelopeTable#rollback() (Line 348)
and state-package.
Note:
Before changing an object you need to lock
the object or you have to make it 'dirty' by your own
using
((TransactionExt) tx).markDirty(obj);
current CVS
or
rc4
((TransactionImpl) tx).markDirty(obj);


pb-layer does not use Synchronization, thus a rollback is
only done on connection level.
If you want to synchronize
the cache you have to do this by our own (clear cache, ...)
or synchronize the cache with your jotm-transaction by
implementing your own ObjectCache.

HTH
regards,
Armin

> Armin Waibel wrote:
>
> >Hi Jean-Pierre,
> >----- Original Message -----
> >From: "jean-pierre lerbscher" <[EMAIL PROTECTED]>
> >To: "OJB Users List" <[EMAIL PROTECTED]>
> >Sent: Tuesday, September 23, 2003 10:02 AM
> >Subject: Re: Problem : stale data when jta transaction rollback
> >
> >
> >>Could you give me an explanation (Armin or ... )?
> >>What's happen when that an external transaction abort ?
> >>
> >
> >It's a known problem. We currently discuss to
> >introduce a pluggable two-level cache to avoid dirty reads
> >when using a global cache.
> >To avoid described problems you can
> >
> >- use ObjectCachePerBrokerImpl as cache and
> >when using current version from CVS it is possible to
> >declare caches per jdbc-connection-/class-descriptor
> >(see http://article.gmane.org/gmane.comp.jakarta.ojb.devel/3763
> >+ javadoc of cache-package classes)
> >you can use global cache for read-only classes
> >
> >- write your own two-level ObjectCache implementation
> >depending on jotm
> >
> >regards,
> >Armin
> >
> >>Regards,
> >>JP
> >>
> >>jean-pierre lerbscher wrote:
> >>
> >>>Hi,
> >>>I observed the problem with db-ojb-1.0.rc2 and db-ojb-1.0.rc4. I'm
> >>>using odmg api.
> >>>My transaction is obtain from a jta transaction manager (jotm).
> >>>I search and lock an object to update this value, the transaction
> >>>fails, and when I seek the object again, i obtain the modified
value
> >>>of the object although the data base is not updated. I think that
> >>>there is, in this case, a problem of stale data in a cache.
> >>>ObjectCacheClass=org.apache.ojb.broker.cache.ObjectCacheDefaultImpl
> >>>
> >in
> >
> >>>ojb.properties
> >>>Somebody it already encountered the problem.
> >>>Regards,
> >>>jean-pierre
> >>>
> >>>
> >>>
>
>>---------------------------------------------------------------------
> >>
> >>>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]
> >>
> >>
> >>
> >
> >
> >
> >---------------------------------------------------------------------
> >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