Hi,
I am facing a major problem of getting sporadic results with OJB on
WebSphere. I am using OJB 0.9.5, WebSphere 4.0 fixpak4 and DB2.
I have a USERS table which has about 190 records that match the
search criteria. But upon running the following query I only get 1 record
the first time. When I repeat the search with the same criteria, I get a
few more records in the result. I have to repeat this a few times before I
get the total set of results. Following is the code -
PersistenceBroker _broker = null;
Collection users = null;
Query q = null;
User[] userArray = null;
int count = 0;
int totalUsers = 0;
_broker = PersistenceBrokerFactory.createPersistenceBroker( new
PBKey( "repository.xml" ) );
q = new QueryByCriteria( User.class, null );
users = _broker.getCollectionByQuery( q );
totalUsers = users.size();
userArray = new User[totalUsers];
userArray = (User[])users.toArray(userArray);
for (count = 0; count < totalUsers; count++)
{
out.println("" + count + ". " +
userArray[count].getFirstName());
}
Would greatly appreciate if anyone who has faced this problem and has
a solution for it, could post the solution in the discussion.
Thanks and Regards
Ramkumar Ampavathina
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>