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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T19:52:28+00:00 2026-06-14T19:52:28+00:00

When I load() an object hibernate return me a proxy object and when I

  • 0

When I load() an object hibernate return me a proxy object and when I get() an object hibernate return me a new instance of this object.

But If I have for example: One Exercise has many Categories and One Category has many Exercises and there are 4 categories that always are same: A, B, C, D

When I get an Exercise with its category, e.g. A and then get other with A too.

Have I two instances of A? Because A is the same for all exercises. How can I share the same reference for all Exercises?

  • 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-14T19:52:29+00:00Added an answer on June 14, 2026 at 7:52 pm

    Hibernate’s Session ensures that no duplicated objects are loaded. You’ll have several references to the same objects.

    If you loaded the same object twice in 2 sessions and then you’re trying to save both in a single session, you’ll get an exception that would state that there are 2 same object associated with the session.

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

Sidebar

Related Questions

I have two pages, test1.aspx and test2.aspx test1.aspx has this protected void Page_Load(object sender,
I have a Hibernate entity which has one or more <many-to-one mappings, e.g. <hibernate-mapping>
I have a problem using Linq to NHibernate to load an object and eagerly
If I've gotten a persistent object from the database via NHibernate's Get() or Load()
I have this: protected void Page_Load(object sender, EventArgs e) { nome_Txt.Text = Profile.dados_pessoais.nome; }
How to load complete object (that has all asociated objects within) using Fluent NHibernate?
I have a root object that has a property that is a collection. For
We have a two tier Swing application using Hibernate. Sometimes we manipulate an object
I've got a pretty complex object graph that I want to load in one
I have a simple object relation, I wish to persist with hibernate. Basically, its

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.