When loading objects from the database, these objects are "managed objects". If you change the "managed objects" (and send the transaction later), you do NOT need to keep them explicit. (This is what βmanagedβ means).
But Hibernate will not immediately update the database, instead it will wait:
- you are making a transaction
- you call
EntityManager.flushor - You are executing a database query or saving sleep mode! (when you go around Hibernate and execute a query, for example, using a simple JDBC / Spring JDBC template, then you need to call first
EntityManager.flushif you do not see non-jet flushed data ( fooobar.com/questions/1584277 / ... ))
And this is what you observed:
- 1) you load some objects, so they become manageable
- 2) , hibernate sql
- 3) - , .