Hi,
I'm experimenting again with porting our ORM framework over to hibernate, but seem to have the luck finding the weaknesses of hibernate all the time...
This time, as I've given up upon my "mixed mode mapping", I took one slightly larger project (400 classes) over to hibernate and ran into memory probs.
First of all, switching off batching helped a little bit in getting the memory consumption from 145 MB (!) down to some 50 MB. Still much too huge (Castor needs only 20 MB), so I decided to delve into the source together with my profilers help and voilĂ it's the saved queries. After patching AbstractEntityPersister to create its queries at runtime I could shed it down to some 25 MB (that it, still some 10 MB static query strings).
Now, after some performance tests I decided that it would be better to try table per concrete class inheritance mapping. So I created the necessary converter classes for my data and failed due to instantly crashing my JVM during creation of the SessionFactory. Analyzing this further showed me, that the queries generated by this kind of mapping are, ehem, *huge*. 1.6 MB for one query. Multiply this by about a few thousand (ok, not *all* queries are that big, but the more polymorphic, the bigger), and you see, why.
Question now is, is there any possibility except stored procedures or views to get around this problem (=runtime generation of the queries, completely omitting this rubbish, shortening the aliases, things like that), or is the only advise available to work with views?
Thanks in advance!
Patric
|