Hello

I'm experiencing some unexplainable behavior of a QueryResults instance. I've made some junit tests to be sure that the problem can be reproduced.

If I perform a query and iterate over the resultset, things work as one should expect.
I begin the transaction create an OQL statement, execute the query, iterate over the resultset and commits the transaction.
Everything works fine.

Now if I move the iteration from the body of the same method into another method. Then the resultset only gives me 1 iteration whilst there are more elements obtained from in the  query. I begin the transaction, call the method that does the querying, receive an open resultset of type QueryResults, start iterating, commits the transaction and closes the QueryResults. If I do this I only obtain one element although if I perform the same query as in the above stated scenario, the only difference is that the iteration is performed within the body of another method.

So only by returning a reference to a QueryResults around to makes it "forget". I know this sounds almost impossible but there is definitely something wrong. I single stepped with the aid of a debugger but couldn't find anything wrong.

I'm using the win32 jdk 1.3.1-b24 in mixed mode with hotspot enabled and the Eclipse R1.0 IDE

The oql query by the way is:
"SELECT a.reciprocal.type FROM org.moss.meta.assoc.AssociationEndImpl as a WHERE a.type=$1 AND a.association=$2"

Where AssociationImpl class has a reference of the same type called "reciprocal", a reference to TypeImpl called "type" and a reference to AssociationImpl called "association". This query works OK and the generated SQL is correct.

Hope someone can verify a similar problem.
Thanx in advance.
Eduard.

Reply via email to