How the hibernation session works

I have some trivial queries in Hibernate.

  • If I assume there are two instances, and each uses its own sleep mode session. If one session inserts data into the database, and the second session tries to get new data, will it be able to get this data?

  • I set the primary key that will be generated by the database sequence. Therefore, I create an instance and call save (), but do not commit the transaction. I can still get the id of this instance. Is there a DB call at this moment, or how does sleep mode support the session?

+3
source share
1 answer
  • yes, as soon as the data is transferred to the database; it depends on the isolation level configured in the transaction

  • , - select nextval('MY_SEQUENCE');, , ; , .

.

+2

All Articles