Announcement Announcement Module
No announcement yet.
Lazy Loading changes from Spring Flex 1.0.3/BlazeDS 3 and Spring Flex 1.5/BlazeDS4 Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • Lazy Loading changes from Spring Flex 1.0.3/BlazeDS 3 and Spring Flex 1.5/BlazeDS4

    I have done an upgrade from Spring Flex 1.0.3/BlazeDS 3 to Spring Flex 1.5/BlazeDS4 and the Lazy loading behaviour has changed and now works as
    Jeremy describes in thread:

    >You need to use either SBI 1.5M2, or one of the latest 1.5 nightly builds in order to get Hibernate support out-of-the-box. That said, the way we approach it is rather different from the approach of >dpHibernate. We simply ensure that any uninitialized Hibernate proxies or collections get converted to null during serialization, allowing you to use the detached entity pattern without receiving >LazyInitializationExceptions. It is up to you to make additional remoting calls when you need to later retrieve the uninitialized portions of your object graph.

    This is exactly the behaviour that I am getting now - lazy collections have a value of null.

    Previously in Spring Flex 1.0.3/BlazeDS 3 when I retrieved a DTO with lazy one to many relationships, it retrieved all the data before it serialised back to the client and there
    were no LazyInitialisation exceptions. This was done by adding a JPA OpenEntityManagerInViewFilter to the web.xml:

    <filter-class> tyManagerInViewFilter</filter-class>

    If the filter was not present, you would get the error "failed to lazily initialize a collection of role".

    In Spring Flex 1.5/BlazeDS4, I guess I now have retrieve the lazy collections explicitly and the filter cannot be used to
    resolve the lazy collections.

    Is there a way that the filter to retrieve the lazy collections automatically can be used in a Spring Flex 1.5/BlazeDS4?