Hi,

during our development process we frequently change the schemas of the
documents we insert. We also encountered the problem of the expanded tree
cache keeping previous versions of the schemas in version 7.

therefore, in our continous integration process one of the scripts that are
run makes sure the expanded tree cache is empty (as indicated by Mary),
here it is:

xquery version "1.0-ml";
import module namespace admin = "http://marklogic.com/xdmp/admin";
  at "/MarkLogic/admin.xqy";

(: After a schema update, the expanded tree cache needs to be cleared -- so
documents linked to the old schemas will be re-validated with the new ones
:)
(
    xdmp:expanded-tree-cache-clear(),
    'Cleared the expanded tree cache!'
)

;


cheers,
Jakob.


On Mon, Jul 14, 2014 at 9:27 PM, Mary Holstege <[email protected]>
wrote:

> On Mon, 14 Jul 2014 10:43:40 -0700, Tim <[email protected]> wrote:
>
> > How do I clear the expanded tree cache?
>
> xdmp:expanded-tree-cache-clear()
>
> You need to be admin to run it.
>
> >
> > Tim
> >
> > -----Original Message-----
> > From: Mary Holstege [mailto:[email protected]]
> > Sent: Saturday, July 12, 2014 9:56 PM
> > To: 'MarkLogic Developer Discussion'; Tim
> > Subject: Re: [MarkLogic Dev General] Strict validation error encountered
> in ML7 but not in ML6
> >
> > On Sat, 12 Jul 2014 12:45:47 -0700, Tim <[email protected]> wrote:
> >
> >> After a little more investigating, it looks like there is a problem
> >> updating a schema.  In this case I'm simply adding some optional
> >> element attributes to the schema and updating it in the schemas
> >> database, but strict validation of a document is failing.  When I
> >> revert back to the previous schema it validates just fine.  What is up
> with that?
> >
> > A couple of thoughts here:
> > Do you have other schemas around for the same namespace?
> > Unless you are very careful with schema locations in that case, the
> lookup-by-namespace may grab the wrong one.
> >
> > You might also try clearing the expanded tree cache after loading a new
> schema. The schema information associated with a particular document is
> cached in the representation of it in the expanded tree cache and that can
> be sticky across changes to a particular schema stored in the database.
> > The system isn't really designed to accommodate on-the-fly schema
> changes like that.
> >
> >> It also appears that my schema was updated automatically at some point
> >> to include the use="optional" attribute  for optional schema
> >> attributes and that elements were updated with the nillible="false" and
> abstract="false" attributes.
> >> I don't understand why this happened.  Fortunately the update posed no
> >> problems with validation, but it is out of sync with the original
> >> schema in my repository
> >> - kind of weird.
> >
> > I think what you are seeing here is defaulted attributes being
> serialized.
> > (They are getting defaulted from the schema-for-schemas). This is a
> serialization issue entirely, and there are controls for when they get
> included in serialization. I suspect you may be copying the schema XDM
> instance in some way, because the default is to not include them in the
> serialization.
> > More recent versions avoid serializing them on copies as well.
> >
> > //Mary
> >
> > _______________________________________________
> > General mailing list
> > [email protected]
> > http://developer.marklogic.com/mailman/listinfo/general
> >
>
>
> --
> Using Opera's revolutionary email client: http://www.opera.com/mail/
> _______________________________________________
> General mailing list
> [email protected]
> http://developer.marklogic.com/mailman/listinfo/general
>
_______________________________________________
General mailing list
[email protected]
http://developer.marklogic.com/mailman/listinfo/general

Reply via email to