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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T00:12:18+00:00 2026-06-15T00:12:18+00:00

I have a quite interesting issue. I set some values on the server, send

  • 0

I have a quite interesting issue. I set some values on the server, send the bean to client and then it comes back to the server without that values.

Here is what I do:
1. Client requests some beans from DB through EntityRequest.getEntity(params)
2. I fetch a bean from database through Hibernate
3. I set some transient property (I need them on client side and don’t want them to store in DB)
4. Send the bean through EntityRequest’s method to client.
5. Client changes some other values and calls persist.
6. Server receives back his bean and
– is has properly set properties from the client
– the property set from the server (step no. 3) are ERASED / IGNORED.

It looks like RF mechanism would send me freshly DB loaded version with only changes from client. I did some research and it looks like there must have been some bean version issue. The bean has version set (see below) and it is used by Hibernate and I guess by RF also.

What should I do to get my value to client and back? I tried some “entity.version++;” on step 3, but it doesn’t work.

@Entity
public class Person {

    @Id
    @GeneratedValue
    private Long id;

    @Version
    private Integer version;

    @Field
    private String name;

    @Transient
    private Long participationId;

    ...

    public Long getId() {
        return id;
    }

    public Integer getVersion() {
        return version;
    }

    ...
}

public static Person findPerson(Long id) {
    Session session = HibernateUtil.getSessionFactory().getCurrentSession();
    session.beginTransaction();
    try {

        Object p = session.get(Person.class, id);
        session.getTransaction().commit();

        return p != null ? (Person) p : null;

    } catch (RuntimeException e){
        logger.error("Person.findPerson", e);
        session.getTransaction().rollback();
        throw e;
    }
}
  • 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-15T00:12:19+00:00Added an answer on June 15, 2026 at 12:12 am

    With the help of Thomas Broyer I understood more the RequestFactory mechanism and this has led me to the solution. RequestFactory on returning the object from client side does not take domaing object out of a cache but rather fetches fresh one and does diff to it. The fetch is done either using Locator or domain objet’s find(id) function. In my case was find(id).

    The solution is an ugly hack, I know, but it works. This is on my entity

    public class Person {
    ...
    @Transient
    private Long participationId;
    
    @Transient
    private Long participationStoreId;
    ...
    }
    

    Before I sent it to RF I load participationId. On the client side, to keep it, before sending back I do:

    person.setParticipationStoreId(person.getParticipationId());
    

    Before you throw eggs at me, I repeat: I know it is an ugly hack. But in some cases I need some value on entity to the client and back and I don’t want it in DB. This was the only way that works.

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

Sidebar

Related Questions

I have recently started diving into Haskell. Its quite interesting, but the definition of
I have an interesting situation on my hands, and I'm not quite sure how
This is quite an interesting question so let me set the scene. I work
I have encountered an interesting issue in which I have my master trying to
I have an interesting issue where I need to round the result of an
I have quite an interesting task at work - I need to find out
I recently came across the link below which I have found quite interesting. http://en.wikipedia.org/wiki/XOR_linked_list
In an algorithms course quite some years ago, I came across an interesting graph
This is a quite interesting question, in my opinion. I have a strongly typed
This is quite an interesting issue I'm having with z-indexes that I've never encountered

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.