You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Everything is fine, but if it's about performance, merge operation takes large amount of time and can cause real performance troubles. For instance, according to my inaccurate time measurements, removing 5000 entities takes ~4s, in hibernate-orm it takes 50ms.
I've just read about a new method called session.getReference which returns the persistent instance of given entity. Is it possible to allow its use for session.remove?
The text was updated successfully, but these errors were encountered:
I've just read about a new method called session.getReference which returns the persistent instance of given entity. Is it possible to allow its use for session.remove?
Ah, good point, absolutely you should be able to do that. I've made it work in #360.
However, I want you to understand that there's no way to remove() an object without fetching it first. That's because remove() has semantics like cascade delete, and collection removal that depend on having the state of the entity in the session.
If you absolutely need to be able to delete an entity without fetching it, you should use StatelessSession.delete() or a HQL delete query.
No problem, thanks for your detailed response about removing operation and for a very quick fix. I'm conducting experiments right now and rewriting my server-side application using your new amazing library, so its easy for me to catch some tricky issues, which could only be captured only so (or using a large number of tests 😄)
Hello, as i understand, following jpa, there is only one way to remove detached entity:
Everything is fine, but if it's about performance, merge operation takes large amount of time and can cause real performance troubles. For instance, according to my inaccurate time measurements, removing 5000 entities takes ~4s, in hibernate-orm it takes 50ms.
I've just read about a new method called
session.getReference
which returns the persistent instance of given entity. Is it possible to allow its use forsession.remove
?The text was updated successfully, but these errors were encountered: