You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@openjpa.apache.org by kai <ka...@gmail.com> on 2010/07/22 18:52:03 UTC
Persistence Context advice.
Hi,
I know the difference between Transaction Persistence Context and the
Extended Persistence Context (in terms of functionality).
However, Is there any general advice as to when to use Transaction
Persistence Context and when to use Extended Persistence Context?
For what I see, the Extended Context is what most people would expect
when they work on an entity because we don't have to tight to a
transaction when we lazy load a relation?
Is there any penalty if we use Extended Persistent Context vs
Transaction Context?
Is there any thoughts/advices about this from the dev. team?
Thanks
Re: Persistence Context advice.
Posted by Pinaki Poddar <pp...@apache.org>.
One rule of thumb is "shop-to-buy-ratio". A term coined for web-based
application, it denotes the ratio of transactions that only read data as
opposed to the ones that really create/update/delete. In typical travel web
sites (I have heard) the ratio is 200:1.
In such read-mostly scenarios an extended context can be more effective than
a transactional context. On the other hand, if the transactions are
predominantly write-intensive -- there is less utility in caching data
across transactions in extended contexts.
However, significance of this choice between the scopes of the persistence
context is somewhat lessened by the usage of L2 caches especially if you use
one that resides in the same memory space.
-----
Pinaki
--
View this message in context: http://openjpa.208410.n2.nabble.com/Persistence-Context-advice-tp5326284p5342345.html
Sent from the OpenJPA Users mailing list archive at Nabble.com.