attachGoldenThread
Layer1
Release Notes
attachGoldenThread
cast
copy
cutGoldenThread
cwu
delete
dpml
dump
entrypoint
exists
expire
fls
guid
hotRestart
HTTPCookie
HTTPRedirect
isUnix
locationToXPath
lock/unlock
log
loglevel
luceneIndex
luceneSearch
mapper
mapper-export
md5
mls
netkernel:*
new
Orchextra
org.ten60.util.aspell
org.ten60.util.image.SVG2PNG
org.ten60.util.image.Text2PNG
org.ten60.util.image.xchart
plainTextToXHTML
regex
relativizeURI
requestWithArgs
resolveURI
serialize
sleep
sqlBatch
sqlBooleanQuery
SQLEncodeElement
SQLEscapeXML
sqlQuery
sqlUpdate
stm
stopWatch
StringToCanonicalString
throw
toRelaxNG
trace
validateDTD
validateRNG
validateSchematron
validateXSD
xacml
xform
XHREFlinker
XHTMLredirect
XHTMLTidy
xinclude
xmltidy
xpatheval
xpur
xquery
xrl
xsign
xslfo-fop
xslfo-fop
xslt
xverify
License
Change History
NetKernel History
Acknowledgements

attachGoldenThread/cutGoldenThread

Used to attach/cut a GoldenThread dependency to a resource.

Module

urn:org:ten60:netkernel:ext:layer1

Definition

Format

<instr>
  <type>attachGoldenThread</type>
  <operand>var:myresource</operand>
  <param>var:resource</param>
  <target>var:attachedResource</target>
</instr>

Syntax

ElementRulesDescription
typeMandatory attachGoldenThread/cutGoldenThread
operandMandatory the resource to attach Golden Thread to.
paramMandatory The URI which is the Golden Thread.
targetMandatory the resource with attached thread

NetKernel provides a dependency based cache. In general resources are generated from a tree of dependent resources. If one of the resources expires then all dependent resources expire. For general processing this happens transparently and automatically.

In certain circumstances, for example database queries, it is not possible to create a URI based dependency that will automatically expire. For example if a database update is performed it would be good to tell all cached previously derived results that they are no longer valid.

A Golden Thread is a common dependency URI across any number of resources. It is attached with the attachGoldenThread accessor. Any number of dependents can be strung with a single golden thread URI. All will be caheable and depend directly on the validity of the Golden Thread.

At any time the Golden Thread can be cut with the cutGoldenThread accessor. All resources linked by the Golden Thread will be immediately expired and the Kernel will discard cached value and/or rebuild the resources.

Note: in general processing NetKernel does not require GoldenThreads to be used. It will automatically detect dependencies and invalidate dependent results if a resource expires. GoldenThreads are necessary with legacy resource sources such as relational databases where a resource may become invalid by the action of the application (an update invalidates a query result) and for which the resource is generated outside of NetKernels addressable URI space.

Example

Here's an example that attaches a Golden Thread to the results of a DB Query for customers. Note the Golden Thread URI is not a real resource it is just a URI that is unique to this Thread. NetKernel will cache the result of the query.

<instr>
  <type>attachGoldenThread</type>
  <operand>var:myCustomerQueryResult</operand>
  <param>goldenthread:customerDB</param>
  <target>var:myCustomerQueryResult</target>
</instr>

Suppose we now update the database. We can invalidate all results attached to the Golden Thread by cutting it...

<instr>
  <type>cutGoldenThread</type>
  <param>goldenthread:customerDB</param>
</instr>

All resources attached to the customerDB Golden Thread will be immediately invalidated and will be removed from the cache.


(C) 2003, 1060 Research Limited
© 2003,2004, 1060® Research Limited
1060 registered trademark, NetKernel trademark of 1060 Research Limited