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]



Reply via email to