Hello Armin,

I just found another thread which has the same topic. There you mentioned that it is possible to define different threads for each connection-descriptor. So if I declared something like

<jdbc-connection-descriptor ...>
...
<object-cache class="org.apache.ojb.broker.cache.ObjectCachePerBrokerImpl">
</object-cache>
...
</jdbc-connection-descriptor>


then everything would behave as one might expect? would'nt it?
Tino


Armin Waibel wrote:


Hi Tino,

Tino Sch�llhorn wrote:

Hi,

I have a very, very strange phenomenom: I have one web-application which handles several clients. Each client uses its own database, but the database schema is always the same.

Our web-application handles requests for all clients, so I have to switch the PersistenceBroker as soon as I notice that another client should be handled.

This generally works fine when testing one client, but when testing other clients simultanously data of client A appears in the results of client B and vice versa. The most funny (?) thing is that the visible data switches from client A to client B after a few clicks.

Is it possible that the cache ojb-uses doesn't respect the different PersistenceBrokers? That would explain the described behaviour.


If you use the default cache (ObjectCacheDefaultImpl) implementation you are right. This implementation is shared and only based on persistence capable object Identity instances. All your databases use the same schema, thus same Identity object can arise.
See
http://db.apache.org/ojb/objectcache.html#Shipped cache implementations


How could I turn off the cache, so I can verify this ?


You can use ObjectCachePerBrokerImpl instead.


Do you have other ideas which I might try ?


You can write a shared cache based on the used PBKey.


regards,
Armin

I am using ojb1.0rc5

With regards Tino



---------------------------------------------------------------------
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