Hi Andrey,

In the Collection class, there is a method with the signature:

Collection getChildCollection(String name) throws XMLDBException

If the child collection exists, it returns a valid Collection instance.
If the child collection does NOT exist, it returns null.

I suggest using this, to determine if a collection exists before using
CollectionManagementService to create the collection.

Maybe something like:

Collection coll; // Assume has instantiated.

Collection child = coll.getChildCollection("myChild");
if(child == null)
  child = CollectionManagementServiceInst.createCollection("myChild");

Regards,

Charles

> Hello,
>
> I use Sedna XML:DB API 1.1.4.
>
> Is there any way to open a collection: that is:
> (1) find and use it, if it already exists;
> (2) create and use it, if it does not.
>
> I did no find corresponding method in CollectionManagementService class.
>
> Catching the exception is recommended way to do so?
>
>
>
> Best regards,
>
> -Andrey
>
> ------------------------------------------------------------------------------
> This SF.net email is sponsored by:
> SourcForge Community
> SourceForge wants to tell your story.
> http://p.sf.net/sfu/sf-spreadtheword
> _______________________________________________
> Sedna-discussion mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/sedna-discussion
>


------------------------------------------------------------------------------
This SF.net email is sponsored by:
SourcForge Community
SourceForge wants to tell your story.
http://p.sf.net/sfu/sf-spreadtheword
_______________________________________________
Sedna-discussion mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/sedna-discussion

Reply via email to