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 Sergey Manukyan <sm...@gmx.net> on 2003/09/26 16:09:18 UTC

caching problem ?

Folks,

I have this code that doesn't work correctly.
Trying to query all objects from database and receiving them always from
the broker's cache. So now I am cleaning the cache every time before query.
Can I do it in any other way so that I don't need to clear the whole cache
every time?

//-- THIS IS THE CODE

	public Collection findAll(Class clazz) {

		Collection retVal = null;
		PersistenceBroker broker = getBroker();
		/* SHOULD UNCOMMENT IN ORDER TO WORK
		 broker.clearCache(); 
		*/
		Criteria selectAll = null;
		Query query = QueryFactory.newQuery(clazz, selectAll);
		retVal = broker.getCollectionByQuery(query);

		return retVal;
	}

//--

Thank you,
Sergey Manukyan



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