qmartek wrote:
The TestBean adds statistics (using a java.util.Set with lazy invokation).
Like: new TestBean().addStatistics(new StatisticsBean());
Now, it seems like all instances belonging to a perticular testBean are beeing created each time new statistics are beeing added to the Set.
Here's my guess (perhaps not a good one). Since it is a Set, all elements must be unique. It has to therefore test this, and the only way to test uniqueness is to load the Set. Perhaps you want a Bag for this (allows duplicates, so in some cases will be faster at inserts, but slower at updates).
See
http://www.hibernate.org/hib_docs/v3/reference/en/html/performance.html#performance-collections-mostefficentinverse