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

  • Home
  • SEARCH
  • 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 8737473
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T10:31:52+00:00 2026-06-13T10:31:52+00:00

I am currently working on a distributed application using the following components: 1.tier: Database-Server

  • 0

I am currently working on a distributed application using the following components:

1.tier: Database-Server -> MySQL 5.5

2.tier: Application-Server -> Glassfish 3.1.2.2

3.tier: Stand-alone Fat-Client -> Java-SE (JRE 6)

I use JPA 2.0 (eclipse-link) as persistence provider and currently passing the @Entity beans between the 2nd and 3rd tier using serialization. I use static weaving in order to benefit from lazy fetching supported by JPA.

My problem is, that because of serialization between 2nd/3rd tier lazy fetching won’t work! That results in heavy network traffic, since every serialization of one of my entity beans requires that all relationships to other entities/tables are fetched before sent over the network.

How can I benefit from JPA lazy fetching in such a setup? Is there a work-around without the need to introduce leightweight DTO/DAO (this would add huge complexity to my project) ?

Many thanks for your help in advance!

  • 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-13T10:31:53+00:00Added an answer on June 13, 2026 at 10:31 am

    We solved this issue by using load groups and query hints in order to define the depth of the relations that should be fetched in a particular query. This requires lazy fetching and therefore weaving when using eclipse-link as JPA provider.

    Here’s a short example:

    Server side query on a particular facade:

    @Override
    public List<Contact> query(LoadGroup group) {
        TypedQuery<Contact> query = em.createQuery("SELECT c FROM Contact c", Contact.class);
        if(group!=null) { query.setHint(QueryHints.LOAD_GROUP, group); }
        return query.getResultList();
    }
    

    Client side query on that particular facade:

    LoadGroup group = new LoadGroup();
    group.addAttribute("telephone");
    group.addAttribute("address.street");
    List<Contact> contacts = remoteContactFacade.query(group);
    

    In this example the Contact table has further many-to-one relations to the Address and Telephone tables. By using the dot notation you can define the depth of what should be fetched.

    Hope this helps.

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

Sidebar

Related Questions

I am currently working on a distributed processing application written in Python that utilises
I am currently working on a rather large project with a team distributed across
Currently working with the following package structure: /package __init__.py final.py /write __init__.py write.py /data
Am currently working on an application that requires users to submit posts and comments
I'm currently working on a Python/Twisted project which is to be distributed and tested
I'm currently working on the following homework: CREATE TABLE T_1 (COURSE_NO CHAR(8) PRIMARY KEY,
I'm working on an application for my distributed system laboratory course. I have a
I'm currently working on a distributed networking project for some networking practice and the
I'm currently working on implementing the Distributed Annotation System-standard for our project openSNP.org, however,
I am currently using memcached with my java app, and overall it's working great.

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.