> Philipp Gasser wrote:
> > Hello Armin, 
> > 
> > The situation looks like this:
> > - each work will be tracked by a job-object
> > - 1st run, insert address objects, and others witch are related
> > - each addressobject contains a unique emailaddress (per job)
> > - 2nd run, insert of 1st emailaddress (create adressobject) works
> > - for each mailaddress i check, if there is allready an object, which
> has
> > the same emailaddress
> > - the funny thing is, that the method findMailaddress() does not find a
> > previous inserted object. The result is, that in rare situations, i've
> got
> > objects with the same emailaddresses.
> >
> 
> Could this be a concurrency problem? Each PB instance use it's own DB 
> connection, so could it be the case that the created email was not 
> committed before another thread or PB instance call findMailaddress()?
It is a sequence of components, which work with that data. The component,
which inserts the Mailaddress object has just one instance, so this cant be
a problem.
I've just seen, that this bad situation can be reproduced. It is another
component which stores other objects (also my job-control object) and as far
as i can see also the Mailaddress objects (DB-LOG). The Update is forced
through 'auto-update=true' Configuration.
The Situation looks like this
Class::mail (m-m >autoupdat=true) Class::deliverobject (m-m
>autoupdate=true) Class::mailaddress
Maybe this is the point, where the error has to be at?
When i check the db-log, it seems to be ok!


> 
> 
> > I've allready implemented a simple count-method, this method just counts
> the
> > number of addressobject with a specific emailaddress/job. This method
> shows
> > allways the same result. 
> > 
> > I've checked the DB-DEBUG-LOG:
> > the UPDATE/INSERT statements in the logfile, looks fine. Thats why i am
> > thinking, that there is a problem in the cache, or the configuration
> itself.
> > 
> 
> This couldn't be a cache problem, because you are using 
> ObjectCacheEmptyImpl in the jdbc-connection-descriptor. So OJB doesn't 
> cache any objects (only on materialization of object OJB use a temp 
> buffer to avoid endless loops on circular references).
OK
> 
> 
> > The funny thing is, that in a new 'cache'-situation (for example after a
> > restart), everything works fine.
> >
> 
> And it never happen again? Or does it happen again on next creation of 
> an Emailaddress?
After a restart, first run is ok. but when it happend, the it is allways
with the same Mailaddress -> because of this other component (see above).

Thanks for your patience
Philipp
> 
> regards,
> Armin
> 
> 
> 
> > Hope, that it gives some more background.
> > 
> > Regards,
> > Phil
> > 
> > 
> >>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]
> >>
> > 
> > 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 

-- 
+++ Lassen Sie Ihren Gedanken freien Lauf... z.B. per FreeSMS +++
GMX bietet bis zu 100 FreeSMS/Monat: http://www.gmx.net/de/go/mail

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to