Hi Pinaki, On May 27, 2008, at 3:00 PM, Pinaki Poddar wrote:
After some more analysis of refresh() issue...1. it is observed that a refresh of a single, clean instance never hits the database -- irrespective of whether Data Cache is active or not. That doesnot appear spec compliant.
I agree.
2. refresh() behaves differently on current lock level. With NO LOCK itreads from Data Cache; on any stronger lock it hits the database.I am of the opinion that all refresh() must bypass data cache altogether always -- because refresh() seems to express explicit intent of the user to read data from database (say when the application thinks that out-of- bandmodifications may have taken place on the database).
I agree.
3. There is an 'optimization' on BrokerImpl.refresh() -- one for a single entity and other for a collection. Removing that optimization (which leaves some maintenance concern of similar but not same code blocks) is anothersuggestion.
Seems that if the user calls refresh on a single entity or on a collection, then we should hit the database every time. Who are we to know that the database hasn't changed in the last millisecond? Sure, we're smart, but we're not omniscient.
Craig
Comments? -- View this message in context: http://www.nabble.com/datacache-tp17326391p17501042.html Sent from the OpenJPA Developers mailing list archive at Nabble.com.
Craig Russell Architect, Sun Java Enterprise System http://java.sun.com/products/jdo 408 276-5638 mailto:[EMAIL PROTECTED] P.S. A good JDO? O, Gasp!
smime.p7s
Description: S/MIME cryptographic signature
