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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T08:01:58+00:00 2026-05-16T08:01:58+00:00

I’m currently working with on a fat client application using a self written RMI

  • 0

I’m currently working with on a fat client application using a self written RMI server (10 years ago). The server sends EJB1.1/2.0 beans to the client who has full access to these remote objects. After commiting a transaction, all dirty beans are persisted by the server.

The plan is to replace the server by a JBoss5 & EJB3 without (massively) changing the client app (roughly 10000 class files).
A typical client snip would be

UserTransaction tx = ClientCtxManager.getUserTransaction();
tx.begin();
DummyClassHome dummyHome = (DummyClassHome)lookup(DummyClassHome.class.getName());
DummyClass dummy = dummyHome.findByPrimaryKey(1234);
dummy.setValue("Hello World");
tx.commmit();

-> dummy persisted on the server.

On JBoss I use a stateless session bean for executing findByPrimaryKey. In this finder I lookup a RemoteInterface of a stateful session bean, which I would like to use to carry the entity to the client. Because of Serialization/Deserialization the entity looses the connection to the session which would be vital for commiting changes.

// DummyHome implementation
public MyClass findByPrimaryKey(BigDecimal pk)
{
Session s = HibernateUtil.getSessionFactory().getCurrentSession();
MyClassEntity temp = (MyClassEntity)s.get(MyClassEntity.class, (BigDecimal)pk);
// session.contains(temp) delivers true  
MyClassRemote remote = (MyClassRemote)InitialContextFactory.getInitialContext().lookup("DemoEAR/MyClassBean/remote");
remote.setENTITY(temp); // set the member variable of the stateful session bean
//session.contains(remote.getENTITY()) delivers false
return remote;
}

Any suggestions would be appreciated!

  • 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-05-16T08:01:59+00:00Added an answer on May 16, 2026 at 8:01 am

    Your main problem is the system boundaries between the client and server.

    If client and server were local (e.g. web UI with EJB3 back-end), you could change the code with your approach with little effort.

    But in your case, client and server are remote and the EJB3 entity will indeed become detached when it’s returned from the server, which wasn’t the case in EJB2 where Entity Bean were remote objects.

    Distributed transaction which are started on the client-side work with EJB3, but I would advise against it. I understand however that it might be too much to change.

    Possible way to deal with detached entities:

    1. Use an extended persistence context with SFSB, this way the entity remains attached on the client side. I haven’t seen any app using that for real, but that might be something to explore.
    2. Send the EJB3 entity back after you’ve modified it and merge the changes on the server side.
    3. Have a look at H3T. Never used it, but it address some issues related to system and transaction boundaries.

    Hope you will find a pattern that suits you.

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

Sidebar

Related Questions

I'm working with an upstream system that sometimes sends me text destined for HTML/XML
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I am reading a book about Javascript and jQuery and using one of the
I want use html5's new tag to play a wav file (currently only supported
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
We're building an app, our first using Rails 3, and we're having to build
We are using XSLT to translate a RIXML file to XML. Our RIXML contains

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.