Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8053711
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T07:56:27+00:00 2026-06-05T07:56:27+00:00

1. Question What are known strategyies, solutions for LAZY-loading from client side? I was

  • 0

1. Question

What are known strategyies, solutions for LAZY-loading from client side?
I was checking out this stuff http://wiki.eclipse.org/Introduction_to_EclipseLink_Sessions_(ELUG)#Remote_Sessions but not sure if this is a solution to my problem or how to use this.

2. Use-case

I’m developing a three tier application where my presentation layer (Eclipse RCP) is a remote client over network:

[ Eclipse RCP ] <-----(RMI)-----> [ [EJB 3] [JPA 2] [Mysql] ]

Now, I use JPA Entities as my domain model which I want to use in my client as well. I get the entites from @Session beans over network.
Problem happens when my JPA Entites have LAZY fields. After serialization and especially because my JPA provider (EclipseLink) is over the other side of the network I need a strategy to load those LAZY fields from client.

I’m going to have many entities: 30-40 maybe. And typical scenario would be when the user sees a list of SomethingModel which has many List fields, but those are not needed to be shown on the list, only when she want’s to change a specific element.

3. Possible Solution

I came up with one solution e.g.: I create proxy classes for my JPA entites in client side. When I need a collection field from my Domain model, the proxy class will call the remote EJB to populate the field.

class CarModelClient {
  CarModel model;

  public String getColor(){
    model.getColor();
  }

  public List<Wheels> getWheels(){
    CarModelFacadeRemote carFacade = //get my remote ejb
    model.setWheels( carFacade.getWheels( model.getId() ) );
    return model.getWheels();
  }

}

Well, similar to that.

Thank you for your answers.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T07:56:28+00:00Added an answer on June 5, 2026 at 7:56 am

    Don’t try to be too smart and pretend like the client was on the server, and the entity manager was always open. Consider the domain objects, at client-side, exactly as you would consider DTOs or JSON objects: objects containing some information coming from the server and seralized over the wire.

    Document the service methods called from the client (the facade methods) to specify which associations are initialized and which are not in the returned entities. If you are on some “list” screen and want to see the detailed view of one of the elements of the list, for example, call another service which loads the entity again from the database (and thus gets fresh results), with probably other associations initialized in order to display more details about the entity.

    Trying to dynamically initialize the lazy-loaded associations at the client just doesn’t work: it’s complex, inefficient, results in an obsolete and incoherent graph on the client, doesn’t take transactional isolation into account.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This question is about functions that take arrays of statically known size. Take for
Known Given FontMetrics There is a protected constructor for FontMetrics from Font . Question:
I know this question is really open-ended. Recently migrated from one server to another
this is just a to be sure question here. Are there any known special
This is a known question but the best solution I've found is something like:
This question is similar to How can I specifiy what access I need from
Just known Samsung support RTL for Samsung android device: http://developer.samsung.com/remotetestlab/rtlDeviceList.action [Question] Anyone known other
Just so it's known, this question is mostly academic, even though I tried to
A question from Math Battle . This particular question was also asked to me
I do realize that this question seems very well known, but since I don't

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.