Vamsi Atluri wrote:

> Thanks for the response. In our situation, the users do use the same
> database. Does doing a broker.clearCache() before every broker operation
> overcome the stale data issue?
We don't use any cache to make sure that the user is working with the current
data records. But yo can't avoid all problems in clustering environment by using
no cache. For example Bob is working with a certain data record. Then Carol gets
the same data record from the database. Then Bob is changing the data into the
database. After that Carol is changing the data too and saving them into
database. Now Bobs changes are lost because Carol has the data record
overwritten with her changes. If Bob now loads the data record again, he will
see the changes of Carol.

> However, we noticed that very randomly we get errors like "Borrow broker from
> pool failed, using PBKey org.apache.ojb.broker.PBKey: jcdAlias=something,
> user=something, password=*****" or "java.sql.SQLException: Connection is
> closed. [EMAIL PROTECTED] wrapped
> [EMAIL PROTECTED] ]". 
That isn't a big problem. You can avoid it using the validationQuery attribute
of the connection-pool tag in the repository_database.xml. Here is a example as
well:

<connection-pool maxActive="250" maxIdle ="250" maxWait="2000"
        whenExhaustedAction="0" validationQuery="select count(*) from 
datenklasse" />

See also the OJB documentation.

> even more bizarrely, it says some of the data that we are trying to insert is
> not present while doing a broker.store(), but I can very that the data is
> right there. And very strangely, if we wait a minute or so and attempt to
> save again, it all saves correctly without a hitch.
Make sure that you use only the latest jdbc driver and I think you should use
also the latest jdk and released OJB version. We were able to solve such
problems changing to the latest versions.

Regards,

Thomas

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

Reply via email to