You should not load a million objects in a transaction. This is simply too nonperformant on any database. However, it is not a Hibernate related problem because:
(1) The work done during dirty checking is MUCH, much less that the work done in loading the objects from the database in the first place (approx 5% overhead or less, in typical cases).
(2) There are ways to avoid the dirty check in Hibernate (evict(), clear(), setting the FlushMode, etc).
Hibernate dirty checking is amazingly efficient. Try it.
Quote:
The second requirement is to be able to access the objects after commit.
No problem. You can even reuse them in a new transaction.
Quote:
The third requirement is the ability to use trigers to be able to automaticly update objects in the JVM in case these have been changed in the DB by another user.
It is possible to evict objects from the JVM-level cache or the Session-level cache at any time.
OTOH, a much better solution is to just disable the JVM-level cache for those classes which are updated outside of the application. This is a best-practice solution in ORM.