tenwit wrote:
It's likely that the slow-down is due to proxying and all that. You could try using hibernate only as a simple ORM, with no relationships that will be proxied. If an object A references a small, simple object B, then eagerly fetch it always; if it references a normal/complex object C, then just have a property returning C's id. Whenever you need the C object, use your DAL's factory methods, which will all issue things like session.load(C.class, a.getCid()). It's a complete waste of hibernate's power, but if the proxying is killing your app, then you'll have to avoid using it.
Thanks, that helps. 90% of the objects are simple lookup tables, but the database has 140 different object types, all of which relate to identical database tables with 2-20 records with only an id and a char[30] string.
If I had designed the database I would've done 1 domain/values table with a type table, but I''m stuck with hundreds of identical tables. One database record relates to 20-40 different (but identical) simple lookup objects, each of which is a seperately defined Hibernate object which is mapped independantly. So when you load a record, it is mapped to subobject1, subobject2, subobject3 ... subobject24, subobject25 etc ... all of which are identical in the database but stored in seperate tables. Each has its own POJO. I need to load 3000 of the base objects to display a screen. With SQL tracing on, I see 10-200 generated SQL queries per record, but all I need is the index for the lookups, really. But whenever I suggest caching the text and just dealing with the indexes I get smacked. The problem is I get a massive angry response whenever I try to suggest modifying the system. I can pull and push the data I actually need in binary and it is less than 1K, but the transfer rates are pushing .3 MB per record because of all the mapped sub-objects (at least for the first few records - Hibernate is very good at reusing already pulled records).
Has anybody implemented a fat-client over a thin wire connection? I want to convince them to use an app server.
***Edit: I should clarify - I don't have any control over the actual Hibernate objects. I just have to use them to access the database from my user interface.***