Hibernate version: 3.0
What is the best way to implement seamless out-of-session write behind within a domain model and still use Hibernate?
I know there is a session level write behind cache, but I feel this is not what I need. A few domain classes are updated so frequently, that it is not feasible to always issue an sql update in every transaction. On the other hand it is perfectly safe to save these objects every 5 minutes or so, and only cache their status in the meantime.
After reading Hibernate in Action and the reference doc, I considered a custom persister (but it seems that a class must have exactly one persistence strategy, it cannot use once a custom persister for delayed update, then the default persister to actually update the database). Another but somehow awkward solution: a custom type used in the classes referring to these frequently updated classes. This type would replace standard associations and return the same frequently updated object.
|