You are viewing a plain text version of this content. The canonical link for it is here.
Posted to ojb-user@db.apache.org by Łukasz Korzybski <na...@xtr.net.pl> on 2005/02/01 12:40:09 UTC

Persistent Broker cache impl with ODMG tx

Hello,

I have question regarding per PersistentBroker cache implementation in 
ojb-1.0.1 in Tomcat environment. I use ODMG transactions, and I have noticed 
that when I have two odmg transactions at the same time each in different 
thread, then one of them sees the other's not commited modifications on 
objects (dirty read). 

I have read that PB clears cache when it is returned to the pool, commited, 
aborted. Firstly these two transaction have to use the same PB 
otherwise the problem wouldn't appear (which is logical). But it appears that 
the cache of the PB is not cleared when the first odmg-tx returns PB to the 
pool. 

Should I explicitly invoke close() on PB?

Regards

-- 
----------------------------------
Łukasz Korzybski, naos@xtr.net.pl

---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-user-help@db.apache.org


Re: Persistent Broker cache impl with ODMG tx

Posted by Brian McCallister <br...@chariotsolutions.com>.
No worries =-)

-Brian

On Feb 1, 2005, at 9:33 AM, Łukasz Korzybski wrote:

> Dnia wtorek, 1 lutego 2005 12:40, Łukasz Korzybski napisał:
>
> My mistake sorry, repository_database.xml has overriden settings in
> OJB.properties.
>
> Once more sorry for spamming :)
>
> Łukasz Korzybski
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
> For additional commands, e-mail: ojb-user-help@db.apache.org
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-user-help@db.apache.org


Re: Persistent Broker cache impl with ODMG tx

Posted by Łukasz Korzybski <na...@xtr.net.pl>.
Dnia wtorek, 1 lutego 2005 12:40, Łukasz Korzybski napisał:

My mistake sorry, repository_database.xml has overriden settings in 
OJB.properties.

Once more sorry for spamming :)

Łukasz Korzybski

---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-user-help@db.apache.org


Re: Persistent Broker cache impl with ODMG tx

Posted by Łukasz Korzybski <na...@xtr.net.pl>.
Dnia wtorek, 1 lutego 2005 12:47, Łukasz Korzybski napisał:

I forgot to say that after the modyfing odmg-tansaction is aborted then the 
other starts to see proper, unmodified data, so the cache seems to be 
cleared. 

I have just added broker.clearCache() after line which is retrieving 
modifiable object from db and it helped.


> Dnia wtorek, 1 lutego 2005 12:40, Łukasz Korzybski napisał:
>
> It is strange because in doc I found "So no dirty reads will occur, because
> each thread use it's own PersistenceBroker instance."
>
> I have opened two web browsers each have different session, different
> odmg-transaction, I don't store anything in shared servlet context, what is
> wrong then?
>
> > Hello,
> >
> > I have question regarding per PersistentBroker cache implementation in
> > ojb-1.0.1 in Tomcat environment. I use ODMG transactions, and I have
> > noticed that when I have two odmg transactions at the same time each in
> > different thread, then one of them sees the other's not commited
> > modifications on objects (dirty read).
> >
> > I have read that PB clears cache when it is returned to the pool,
> > commited, aborted. Firstly these two transaction have to use the same PB
> > otherwise the problem wouldn't appear (which is logical). But it appears
> > that the cache of the PB is not cleared when the first odmg-tx returns PB
> > to the pool.
> >
> > Should I explicitly invoke close() on PB?
> >
> > Regards

-- 
----------------------------------
Łukasz Korzybski, naos@xtr.net.pl

---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-user-help@db.apache.org


Re: Persistent Broker cache impl with ODMG tx

Posted by Łukasz Korzybski <na...@xtr.net.pl>.
Dnia wtorek, 1 lutego 2005 12:40, Łukasz Korzybski napisał:

It is strange because in doc I found "So no dirty reads will occur, because 
each thread use it's own PersistenceBroker instance."

I have opened two web browsers each have different session, different 
odmg-transaction, I don't store anything in shared servlet context, what is 
wrong then?

> Hello,
>
> I have question regarding per PersistentBroker cache implementation in
> ojb-1.0.1 in Tomcat environment. I use ODMG transactions, and I have
> noticed that when I have two odmg transactions at the same time each in
> different thread, then one of them sees the other's not commited
> modifications on objects (dirty read).
>
> I have read that PB clears cache when it is returned to the pool, commited,
> aborted. Firstly these two transaction have to use the same PB
> otherwise the problem wouldn't appear (which is logical). But it appears
> that the cache of the PB is not cleared when the first odmg-tx returns PB
> to the pool.
>
> Should I explicitly invoke close() on PB?
>
> Regards

-- 
----------------------------------
Łukasz Korzybski, naos@xtr.net.pl

---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-user-help@db.apache.org