This sounds like a threading issue.
The first task would be to isolate which software layer actually gets the data wrong:
- The database (you may be having dirty reads, check the isolation level).
- The connection pooling library in use, if any.
- The record caching library in use, if any.
- Ebean.
- Any software layer you built on top of Ebean.
- The unit testing code itself.
Fortunately, invalid data is easy to identify as such (nulls in specific record fields), so it should be relatively easy to probe each layer via a conditional breakpoint. If the bug goes away as you add checking, the bug is timing-related and your breakpoint checking took too long - make sure each code path hits at most one breakpoint per record (that probably means checking just one layer per test) and try optimizing the condition checking (avoid String.equals if possible, for example).
HTH
Jo
Well, single-stepping to reproduce the problem obviously won't work, but conditional breakpoints can be used to narrow down the source of bad data.
If you haven't done this yet and want advice, I will provide it.
> Thanks for your suggestions. I hope we can create an example, which shows the behavior.
If the goal is to make the problem reproducible on somebody else's system, you risk ending with something that doesn't reproduce after all and having wasted a lot of work.
Narrowing down the source of nulls will enable others to step in and help; right now, everybody has to wait until you're done, with no guarantee of progress at all.
Regards,
Jo
Sorry, I don't remember which version of ebean you use. But this issues definitely has been fixed. I am aware of it and haven't seen it for a long time now.
I would bet this has is fixed in the latest release either .... else with SVN HEAD this issue should no longer exist.
If so, and it is not yet release, we should release ebean very soon.
Ciao,
Mario
> -----Ursprüngliche Nachricht-----
> Von: eb...@googlegroups.com [mailto:eb...@googlegroups.com] Im
> Auftrag von PlayDeveloper
> Gesendet: Mittwoch, 12. Oktober 2011 14:31
> An: Ebean ORM
> Betreff: [ebean] Re: Ebean shows non deterministic behavior
I just ran a "mvn -Djdk=1.6 clean install" without an problems:
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 53.371s
[INFO] Finished at: Wed Oct 12 22:07:54 CEST 2011
[INFO] Final Memory: 11M/135M
[INFO] ------------------------------------------------------------------------
It is worth fixing your issues, trust me ;-)
Ciao,
Mario
> -----Ursprüngliche Nachricht-----
> Von: eb...@googlegroups.com [mailto:eb...@googlegroups.com] Im
> Auftrag von PlayDeveloper
> Gesendet: Mittwoch, 12. Oktober 2011 20:29
> An: Ebean ORM
> Betreff: [ebean] Re: Ebean shows non deterministic behavior
>
> > > 143)
> > > at
> > >
> com.avaje.ebean.bean.EntityBeanIntercept.loadBean(EntityBeanIntercept.j
> ava:
> > > 548)
> > > at
> > >
> com.avaje.ebean.bean.EntityBeanIntercept.preGetter(EntityBeanIntercept.j
> ava :
Not to me, despite being in Germany myself.
Do you have a link? Google search for Angelika Langer and weak references didn't give me a link to the article, just a lot of pages that mention weak references in passing.
> However it's the same like Threads. Sometimes you really
> need them, but you get the risk, that you run into errors,
> which are really ugly to analyze.
Hmm... this may sound Draconian, but I'd design my unit tests so that they load a library that replaces the WeakReference class with one that always returns nulls.
That way, any bugs of the kind you have experienced will be instantly and reproducably reproduced.
I'm somewhat sceptical of code that retrieves objects from a weak reference and assumes that a strong reference exists. Either the code knows about a concrete strong reference that keeps the weak one alive, then it should use the strong reference; or it does not, then it has no business assuming the weak reference is not null. The middle ground - code knows a strong reference exist but can't easily access it - sounds like a design that might break with the next refactoring.
Again, just my 2 cents.
Regards,
Jo
--
---
You received this message because you are subscribed to the Google Groups "Ebean ORM" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ebean+un...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.