-
1. Re: Tomahawk dataScroller
mirko27 Apr 4, 2006 11:48 AM (in response to coryvirok)Have you put some data into that List?
You have to point to list before you use it. It means you have to initialize it.
Call contacts.size(); before using it.
And that is not crazy way of viewing. It`s how seam see`s it and is not ment to be for youi. -
2. Re: Tomahawk dataScroller
gavin.king Apr 4, 2006 11:56 AM (in response to coryvirok)Either init the collection eagerly, or use a Seam-managed persistence context.
-
3. Re: Tomahawk dataScroller
coryvirok Apr 4, 2006 11:58 AM (in response to coryvirok)Thanks for your reply. I've dealt with the lazy initialization problem before and have done things like "list.size()" to force eager loading. The *correct* solution always seems to be a tweak in the Seam scoping annotations for either the bean or the list I want to outject.
Yes, there is some data in the list and it displays correctly when the page is initially loaded. The problem comes when I use the data scroller to go to the next "page" of data by clicking on the ">" or "next" links.
- Cory -
4. Re: Tomahawk dataScroller
coryvirok Apr 4, 2006 12:01 PM (in response to coryvirok)Thanks for your reply Gavin.
I am using Seam's extended persistence manager:<phase-listener>org.jboss.seam.jsf.SeamExtendedManagedPersistencePhaseListener</phase-listener>
- Cory -
5. Re: Tomahawk dataScroller
gavin.king Apr 4, 2006 2:14 PM (in response to coryvirok)So, as long as you are within the scope of a conversation, and do not serialize the objects, you will never recieve a LazyInitializationException.
Are you sure you are actually using the seam-managed PC in your code (you are not using @PersistenceContext, right?).... -
6. Re: Tomahawk dataScroller
coryvirok Apr 4, 2006 2:23 PM (in response to coryvirok)Correct,
All of my entityManager code uses the Seam @In annotation. -
7. Re: Tomahawk dataScroller
coryvirok Apr 4, 2006 2:33 PM (in response to coryvirok)The only thing I can think is happening is that the dataScroller object is using the fully loaded element inside the DataModel, (which is fine and correct) but inside the dataTable, is is using a member of the current DataModel element which is *not* fully loaded and is doing this outside of the Conversation. (btw my bean is Session, not Conversation scoped.)
Does anyone know or have any examples of using dataScroller with a dataTable that uses a Seam @DataModel that I could see?
Thanks,
- Cory -
8. Re: Tomahawk dataScroller
coryvirok Apr 4, 2006 2:52 PM (in response to coryvirok)The short term work-around is to force loading in a loop for the DataModel's @Factory method, (doing a bunch of System.out() on PKs of elements displayed in the dataTable.) This tells me that the request by the dataScroller is outside of the Conversation scope, (does it cache the DataModel on first load?) or my scoping is getting hosed somewhere.
- Cory