[MarkLogic Dev General] RE: Fragmentation planning
Jason Hunter
jhunter at marklogic.com
Sun Dec 20 21:36:41 PST 2009
Hi David,
The web docs on cts:registered-query() do a pretty good job explaining it:
"Registered queries are persisted as a soft state only; they can become unregistered through an explicit direction (using cts:deregister), as a result of the cache growing too large, or because of a server restart. Consequently, either your XQuery code or your middleware layer should handle the case when an XDMP-UNREGISTERED exception occurs (for example, you can wrap your cts:registered-query code in a try/catch block or your Java or .NET code can catch and handle the exception)."
It's good design to actually *register* your query via the catch or else block. Otherwise you may find later your re-registration logic doesn't exactly match your registration logic.
The cache is fairly large, if I remember right. Something like 64k registered queries can be in operation at once. The fact they work efficiently even in the face of updates is really slick.
-jh-
On Dec 20, 2009, at 3:27 PM, Lee, David wrote:
> I was looking at the Registered Queries and they confuse me a bit.
> What is the lifetime of a Registered Query ? Can I put the ID's in the
> DB itself and save them for a long time or are they lost when the
> session or server ends ?
More information about the General
mailing list