Home  >  Q&A  >  body text

java - Is the data queried by Hibernate stored in the session?

I just learned Hibernate for a while, but after learning about Java serialization, I learned that Hibernate's persistence is serialized into memory, and the last time the data is taken out is deserialization. But I have a question, Hibernate's get and other queries Is it stored in memory through serialization? ? But why does Hibernate's Load method take it out from the session first? ? I am very curious about whether the Hibernate data is persisted in the memory or in the session after it is queried? If it is stored in memory, why is the load method taken out from the session? If it is stored in the session, why is persistence said to be serialized and stored in memory? I have just come into contact with Hibernate for a while. Please give me some advice. Thank you very much! ! !

習慣沉默習慣沉默2712 days ago571

reply all(1)I'll reply

  • 为情所困

    为情所困2017-05-17 10:06:34

    Session is a memory area divided by hibernate. It is a cache area set up to reduce database access pressure. The persistence of hibernate mentioned in the question is by serializing (referring to objects) into memory. I don’t understand this. Persistence The process should be the process of writing data from the non-persistent area of ​​​​memory to disk (database). I can’t remember more details about hibernate. I suggest you read this book to read these concepts;

    reply
    0
  • Cancelreply