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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T13:00:14+00:00 2026-05-23T13:00:14+00:00

In our application we have a dual persistence. First, the entity can be saved

  • 0

In our application we have a dual persistence. First, the entity can be saved online in a MySQL DB (we are using Hibernate), second the entity can be saved locally through serialization.

The entity I’m speaking of is an object of the class User which contains a KnowledgeBase object and that KnowledgeBase contains two lists of entities (List<Card> and List<Deck>).

Both persistences work fine in separate, but there are problems when I try to de-serialize a serialized User object that I loaded from the database, i.e. that has been trough Hibernate at least once (well, twice, actually).

What I’ve noticed is the the ArrayList inside KnowledgeBase are replaced by PersistentBag. Could that that be the source of my problem?

Another guess might be that lazy loading causes these troubles… Is there a way to tell Hibernate to fully load an object at some point? (Apart from eager loading…)

  • 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-23T13:00:14+00:00Added an answer on May 23, 2026 at 1:00 pm

    Yes, Hibernate.initialize(..) initializes objects and collections.

    Then, if needed, you can replace the collections with the regular java.util ones using the copy-constructor: setList(new ArrayList(list))

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

Sidebar

Related Questions

In many places in our application we have code like this: using(RAPI rapi =
I am using a UiTableView in our application.We have two tabs in controller one
in our application we have some kind of online help. It works really simple:
I am attempting to make it so that we can have our application to
we are using NCover from http://www.ncover.com/ For our application we have 6 different solution
Currently we have developed application using Java 6 based on windows 32bit(Dual core &
We have J2EE application built using Hibernate and struts. We have RMI registry based
We recently started using Eclipse to develop our java application and have been running
Each user of our application can have different format for Date and Time. I
our delphi application can have multiple DirectX windows, often on multiple screens. up to

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.