11.07.2015 Views

Oracle Database 11 g - Online Public Access Catalog

Oracle Database 11 g - Online Public Access Catalog

Oracle Database 11 g - Online Public Access Catalog

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

CHAPTER <strong>11</strong> ■ APPLICATION DEVELOPMENT 4615. After INSERT INTO vendors, Call for "Tasty Pastries", notice second cache miss========================================Calling find_Vendor_Id with: The Cookie Placecache miss: The Cookie PlaceReturned Vendor_id : 16. First Call for inserted "Curiosity, A", an uncommitted record========================================Calling find_Vendor_Id with: Curiosity, Acache miss: Curiosity, AReturned Vendor_id : 47. Second Call for inserted "Curiosity, A", an uncommitted record with a secondcache miss========================================Calling find_Vendor_Id with: Curiosity, Acache miss: Curiosity, AReturned Vendor_id : 48. After ROLLBACK, Call or "The Cookie Place", notice cache hit========================================Calling find_Vendor_Id with: The Cookie PlaceReturned Vendor_id : 1Table <strong>11</strong>-4 provides a running commentary on what happened in this anonymous block.Table <strong>11</strong>-4. Code Execution ExplanationTry NumberExplanation1 Call to find_Vendor_Id() for “Tasty Pastries” requires the function body to beexecuted to retrieve the vendor_id.2 Since try #1 already cached this entry, the value is retrieved from the cachewithout needing to execute the function body.3 Call for “The Cookie Place” caches an entry for this vendor. INSERT INTO VENDORSinvalidates the cache.4 A call for “Tasty Pastries” indeed shows that the cache has been invalidatedand the function body is executed to retrieve the value.5 Another call to “Tasty Pastries” shows that while a session has outstandingchanges to any of the RELIES_ON() tables, caching is not performed.6 and 7 The same goes for the inserted or updated records: no caching. ROLLBACKexecuted.8 The cache that was built in tries #1 and #3 is restored.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!