-
1. Re: Please help me understand lazy fetching of a ManyToMany collection.
tony.herstell1 Oct 6, 2008 9:56 PM (in response to beligum.b.beligum.org)Try setting the entityManager to extended; its in the manual how to do this.
The default, for some reason, is not extended (a very weired choice!).
This occurs all the time and may be your problem and really needs to be thought about by the seamsters. If you are using Seam generally you want to use extended... espcaially for people who are not experts!
-
2. Re: Please help me understand lazy fetching of a ManyToMany collection.
beligum.b.beligum.org Oct 6, 2008 10:21 PM (in response to beligum.b.beligum.org)Yeah, I thought of that too, but then, the extended EM should be in put in the Authenticator (or both in the authenticator and SFSB), right? But en extended em is only allowed in a statefull session bean, and it doesn't make really sense to make an authenticator statefull, or am I wrong?
However, I just tried it, and it works. Can I run into problems by defining an entityManager extended in a stateful authenticator-bean? For one thing, it's weird that none of the examples do this.
-
3. Re: Please help me understand lazy fetching of a ManyToMany collection.
tony.herstell1 Oct 8, 2008 10:36 PM (in response to beligum.b.beligum.org)A Seamster expert could help with this question as I don't know.
I was reading vars back all the time by mistake to avoid Lazy Exceptions before I found, by accident, the Extended fix so my code has both ways in it ;)
Perhaps an Q.A. should be added (or a section added to the manual) to the wiki on when to use EXTENDED and when not to.
It's probably very obvious to seamsters on when it should be used; but for simple users like me, I start with Extended and resort to re-reading if that fails... which is probably sub-optimal.
Being a spare time coder in Seam has it's drawbacks.
-
4. Re: Please help me understand lazy fetching of a ManyToMany collection.
samdoyle Oct 9, 2008 7:40 AM (in response to beligum.b.beligum.org)Out of curiosity why are you not using outjection?
@Out(value="authenticatedMember") Member member;
For example
-
5. Re: Please help me understand lazy fetching of a ManyToMany collection.
beligum.b.beligum.org Oct 9, 2008 9:36 AM (in response to beligum.b.beligum.org)Good question.
I did, initially, but since some examplesoutjected
the variable this way, I thought that might have been the problem. But, no ;-) -
6. Re: Please help me understand lazy fetching of a ManyToMany collection.
beligum.b.beligum.org Oct 9, 2008 9:40 AM (in response to beligum.b.beligum.org)Btw, FWIW, I recently found this post.
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3964316#3964316
It's quite dated, but still explains some stuff better than the manual/tutorial does.