New Article: Remote Lazy Loading in Hibernate

Discussions

News: New Article: Remote Lazy Loading in Hibernate

  1. Problems might arise when lazy loaded data objects in Hibernate are transferred to other application layers, especially to remote client. Accessing a detached reference will always lead to some exception. What if these lazy loaded objects can still maintain their references even at the remote client layer and still be able to lazy load data? In this article, Premkumar Rajendran discuss how to address this problem by extending Hibernate’s lazy loading framework to incorporate remote data. Read the article

    Threaded Messages (13)

  2. Not recommended..[ Go to top ]

    Nuno, how does your implementation address the Hibernate team's concern that remote lazy loading breaks the transactional consistency of your domain? I see no explanation on how this very critical issues is addressed. Do you lock the domain object referencing the lazy collection during its entire lifetime - and if so, does this not negatively affect the performance of your application?
  3. ... oops[ Go to top ]

    ... my Bad, I meant to address Premkumar, not Nuno. Apologies, but the question still stands.
  4. I agree with you in non-addressing the transactional features. Locking the domain obj is not a bad idea, but a solution to avail at some situations and I have faced such situations practically. Transaction Mgmt cannot be ignored completely; extending EJB or adding behaviors to Domain object(s), etc are still a possible solution (but meant to increase the complexity) which I am not addressing in this part.
  5. source code[ Go to top ]

    Could you post the source code of your article somewhere? I would like to test this concept for one of my application... Thanks
  6. Source code[ Go to top ]

    Can you send in your email id...
  7. Source code[ Go to top ]

    Could you send me the source code, please? I would like to try to apply your concept in an application... Thanks!
  8. Re: Not recommended..[ Go to top ]

    For reporting purposes, where you don't have any transactional state, something like this is sorely needed. It's a real pain having to call Hibernate to read in all the data and then "touching" it to make sure that it really, really did get read in, when you already have a (possibly) fully-populated object graph.
  9. I don’t understand why do people forget about KISS? Even although it's always sweet. It's good that you look at hibernate internal and played around with it but there could be so many ways simpler ways to solve this problem at API level. How would you deal with transactions, long running use cases and above all maintainability of your application?
  10. I don’t understand why do people forget about KISS? Even although it's always sweet.

    It's good that you look at hibernate internal and played around with it but there could be so many ways simpler ways to solve this problem at API level.

    How would you deal with transactions, long running use cases and above all maintainability of your application?
    Amit, Have you done what you suggested in your reply? I am facing the same issue and I want to make a decision as far as going with Remote lazy loading or simply doing at the API level. Can you explain how you did on the API level? Thanks in advance,
  11. Why?[ Go to top ]

    Just because you "can" do something, doesn't mean you "should". You "can" stand an extension ladder in the back of a pick up truck and cut branches on a tall tree hanging over power lines, but I wouldn't recommend it! What the author has illustrated here is how some people butcher frameworks to compensate for poor design. What's shocking to me is the pride with which the author is showcasing his "solution". He should be ashamed that he ever wrote something that required such antics. This article should serve as an example of what not to do. Rube Goldberg would be proud! (http://en.wikipedia.org/wiki/Rube_Goldberg)
  12. A lot of Ajax frameworks rely on JSON or some form of RPC to transfer data from client to server and back. How does this schema solve the issues of serializing java objects across a javascript based protocol. Seems its not just lazy-loading proxies that cause problems for this type of serialization, but also things like "dirty" flags on Entity beans.
  13. is the statement correct?[ Go to top ]

    One statement in this article goes as "LazyInitializer is a Hibernate component that helps to generate proxy objects for Entities and can also be used to fetch the underlying entities of these proxy objects". I am not sure, but I think LazyInitializer is simply used to initialize(load entity from the database) the proxy object and not 'create' the proxy object. Correct me If wrong...
  14. One statement in this article goes as "LazyInitializer is a Hibernate component that helps to generate proxy objects for Entities and can also be used to fetch the underlying entities of these proxy objects". I am not sure, but I think LazyInitializer is simply used to initialize(load entity from the database) the proxy object and not 'create' the proxy object. Correct me If wrong...