I don't think that OJB is the problem (but maybe I'm wrong). The only difference between the Criteria is the 'distinct' flag. So I this Access has a problem with the distinct flag. Please enable p6spy to trace the generated SQL statements.
See
http://db.apache.org/ojb/faq.html#How can I trace and/or profile SQL statements executed by OJB?
How does the generated SQL for both Criteria look like? Try to invoke these statements against your DB and compare the results. If both statements return the same result ... OJB has a problem ;-)
regards, Armin
Tino Sch�llhorn wrote:
Hello Armin,
I could pinpoint the described error. It all boils to the QueryFactory.newQuery(Class, Criteria, boolean) method. if I execute the code to retrieve an instance of class Person with:
Criteria crit = new Criteria();
crit.addEqualTo("id", "85");
Query query = QueryFactory.newQuery(Person.class, crit);
Collection c = pb.getCollectionByQuery(query);
.... and so on
everything works perfectly and the instances of Person are instantiated correctly. But if I use the method described in the first place:
Criteria crit = new Criteria(); crit.addEqualTo("id", "85"); Query query = QueryFactory.newQuery(Person.class, crit, true);
After that query the LONGVARCHARS aren't correctly instantiated.
I think that this might be an error of OJB.
With regards Tino
Armin Waibel wrote:
Hi,
Tino Sch�llhorn wrote:
Hi,
I have (again) something weird which I suppose is just a configuration problem:
I have a class Person which has one LONGVARCHAR-Field. The first time the object is accessed the LONGVARCHAR-field is returned correctly.
hmm, does this mean first time after creation? Which cache was used?
Maybe first time after store it was found in cache, second time it was read from DB. So I assume your "database" truncate the String on insert.
Maybe I'm wrong ;-)
regards, Armin
But the second time it is accessed it returns just 256 (I suppose) characters.
I am using Access as 'database' but I don't think this is the problem.
Do you have any ideas what I could try? 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]
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
