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 8716355
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T06:03:33+00:00 2026-06-13T06:03:33+00:00

I am currently working on a 3-tier application with Java-EE6 (GlassFish 3.1.2, MySQL Server

  • 0

I am currently working on a 3-tier application with Java-EE6 (GlassFish 3.1.2, MySQL Server 5.1 and Netbeans 7.1.1).

The project currently consists of 3 projects:

  • Enterprise Application / EJB’s: facades to control entities on the database
  • Java Class-Library: @Entity annotated classes that represent the database model (this project is shared by the EE-app and the fat-clients in order to exchange the entity instances between tiers)
  • J2SE Fat-Client: JNDI lookup of server resources (remote access to EJB’s)

For updating the client’s GUIs when entities are created/modified/deleted I decided to make use of JMS by implementing a Topic where each client subscribes on start-up and a message-driven bean on the EJB-container serves as publisher.

Now I face the following big issue:

  • I attached life-cycle listeners (@PostUpdate, etc.) to the entity objects which then should publish the update messages to the subscribed clients. The entity classes reside in the class-lib project, whereas the publisher resides in the EE-app. The problem is, that the EE-app references the class-lib project, but not vice-versa (since cyclic project references are not allowed). Thus the life-cycle callback methods in the entity classes do not have a reference on the message-driven publisher bean in the EE-app.

This is a more design-related question & thus asking you if this is basically the right approach to design a 3-tier application with Java-EE6 ?

I want to avoid DTO/DAO if possible in order to keep complexity as low as possible and the application does not produce heavy network traffic.

Thanks for your advise 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-13T06:03:34+00:00Added an answer on June 13, 2026 at 6:03 am

    I solved the problem by passing the @Entity objects directly between all the layers. By activating static weaving (using eclipse-link as jpa provider) I was able to use lazy fetching for the heavy relations. In order to only fetch particular important relations from the client side, I use load groups to define the lazy relations that should be pre-fetched before serialized over the network which detaches the entity from the entity manager. vis-versa to send an entity to the server again, I just use EntityManager.merge(T) on the server side facade to put the entity back to managed state. This design works fine, even for very complex data hierarchies.

    • 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 application using the following components: 1.tier: Database-Server
I am currently working on a small N-Tier application in C# which uses Linq-to-Entities
I am currently working on a n-tier (3 tiers) ASP.NET web application with the
The application that I'm currently working on is a simple 3-tier web application (whatever
Am currently working on an application that requires users to submit posts and comments
Currently working on database part of android project. The main aim of the project
Currently working on a Spring 2.5 web application, looks as if the business has
Currently working in Java, i'd like to be able to select part of an
Im currently working on a project that requires the following. I need to be
I'm currently on a co-op term working on a project nearing completion with one

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.