Hi Phil,
could you describe more detailed what's going wrong? Do you get a wrong Mailaddress object where specified "emailAddress" and "jodId" doesn't match or get you an "empty" Mailaddress object or 'null'?
Did you check the generated SQL via P6Spy or via DB log?
regards, Armin
Philipp Gasser wrote:
Hello everybody,
i've got a very strange situation, and i hope, that anybody can give me an idea how to fix the problem.
I use: ojb 1.0.3 release db mysql (all type innodb), rel 4.1.11
I have a query situation, which works the first time. But in some cases, it doesn't work -> the result is not valid! The query evaluates, if a specific mailaddress exists or not.
I guess, that it is a cache-problem: I use '<object-cache class="org.apache.ojb.broker.cache.ObjectCacheEmptyImpl"/>'.
code snip: public Mailaddress findMailaddress( final Job job, final String mailaddress ) { Mailaddress aMailaddress = null; final Criteria mailAdressCriteria = new Criteria( ); final Criteria mailAdressAndCriteria = new Criteria( ); mailAdressCriteria.addEqualTo( "emailAddress", mailaddress ); mailAdressAndCriteria.addEqualTo( "jobId", job.getId( ) ); mailAdressCriteria.addAndCriteria( mailAdressAndCriteria );
final QueryByCriteria mailAdressQuery = new QueryByCriteria( Mailaddress.class, mailAdressCriteria ); aMailaddress = (Mailaddress)m_broker.getObjectByQuery( mailAdressQuery );
return aMailaddress; } catch( final Throwable t )
I really hope, that anybody can help me.
Thanks in advance Phil
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
