There are various things that cause difficuilties in Hibernate, and that I hope 
will be easier with Jooq (still not using Jooq yet, unfortunately):
 
1) Session demarcation. Any exception invalidates the Session, which means you 
lose the running transaction and the only recourse is to recreate a Session 
(easy), reload all data (now where's that promise you can code with entities as 
if they were standard Pojos...), redo any modifications (bad if that was a lot 
of work) and commit again (that's easy, again). I hope that Jooq does not tie 
transactional logic to any fragile resources like that.
 
2) It's possible to control which dependent entities are autoloaded in 
Hibernate when loading a main entity, but the API stinks. Several layers of 
fallbacks, needs twiddling in at least two places which use gratuitiously 
different terminology, and in some situations the setting is advisory only i.e. 
Hibernate's behaviour may vary after an upgrade.
I think you always control that explicitly in Jooq.
 
3) Hibernate has three entirely different APIs (Criteria, HQL, SQL), with 
different abilities and different semantics (SQL doesn't affect the session 
cache, for example; Criteria and HQL have a largely overlapping feature set and 
semantics but some things that you can do you cannot do in the other).
If you find that one API does not suit you, you need to rewrite, and the APIs 
are so drastically different that you can throw away the Criteria code you have 
if you need HQL.
Jooq doesn't have this kind of largely overlapping (hence redundant), 
semantically different (hence requiring full rewrites) nonsense. At least I 
hope so :-)
 
4) Hibernate is a bit thin on documenting details. Docs are mostly there, but 
sometimes distributed across official docs, tips&tricks sections, and books; 
plus, sometimes the docs are incomplete and you have to experiment (and hope 
that behaviour doesn't change during the next update).
Can't say much about Jooq's documentation since I haven't used it in anger yet, 
but what I did see didn't look like it left many stones unturned.
 
5) Hibernate is full of subtle semantic distinctions. They're so subtle (but 
important) that, sometimes, the Hibernate team decides to correct a mistake. 
Since the issues are subtle, you don't know your usage of Hibernate was 
affected until the upgrade hits you right in the face.
Jooq has a simpler semantics. That's partly because it doesn't try anything 
fancy with a session cache. (There have been moves towards subtler semantics 
though. I'm a bit worried there.)
 
Just my 2c.
Not all of these points are worded particularly carefully, and some issues I 
haven't thought through to their end; it's more or less my current view of 
things.
HTH.

-- 
You received this message because you are subscribed to the Google Groups "jOOQ 
User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to