Re: [MarkLogic Dev General] Pointing to a database: using its ID?

2012-10-22 Thread Mike Sokolov
On 10/22/2012 10:38 AM, Florent Georges wrote:
>But my concern is that the name is not stable.  You can change
> the name of one database, and in that case I want the config to
> still point to the same database.  Of course, I always display
> the name instead of the ID in the user interface ;-)
>
Hm - renaming - I never considered that; I guess we just don't use that 
feature :)

-Mike
___
General mailing list
General@developer.marklogic.com
http://developer.marklogic.com/mailman/listinfo/general


Re: [MarkLogic Dev General] Pointing to a database: using its ID?

2012-10-22 Thread Florent Georges
Mike Sokolov wrote:

  Hi,

> So if you have, say, a development setup and a production
> setup, they can share the same database names, but not the same
> database ids.  You can always get the id for a name using
> xdmp:database()

  But my concern is that the name is not stable.  You can change
the name of one database, and in that case I want the config to
still point to the same database.  Of course, I always display
the name instead of the ID in the user interface ;-)

  And by nature the config file is not aimed at being shared
between instances, because it reflects a lot of other stuff
installed and managed by the application.  An export/import
process for the whole or part of the "stuff" would make sense
though, but then names would be used as part of that process,
among many other things.

  Thanks for the thoughts Mike, it's been useful to decide that
1/ I want to keep using IDs ;-), 2/ I want to stop using the name
I cache alongside the ID in the config (I rather want to always
retrieve it from the ID when presenting to the user), and 3/
I want to keep the cached name in the config file, just for
debugging purposes...

  Regards,


-- 
Florent Georges
http://fgeorges.org/
http://h2oconsulting.be/
___
General mailing list
General@developer.marklogic.com
http://developer.marklogic.com/mailman/listinfo/general


Re: [MarkLogic Dev General] Pointing to a database: using its ID?

2012-10-22 Thread Mike Sokolov
FWIW, we generally use the database names rather than their ids in our 
configuration files.  It's just easier to see what's going on if you 
have a lot of configuration data to sort through, and as Michael 
Blakeley pointed out, the ids won't be portable.  So if you have, say, a 
development setup and a production setup, they can share the same 
database names, but not the same database ids.  You can always get the 
id for a name using xdmp:database()

Also, there are some APIs (like the Java XCC API) that expect a name for 
specifying a database.  Maybe you can use ids there, too, but I'm not 
sure you can.

-Mike

On 10/21/2012 01:49 PM, Florent Georges wrote:
>Hi,
>
>For some configuration purpose, I have to point to databases
> from a config file.  Can I use the IDs of the databases, as
> returned by admin:get-database-ids()?  Are they guaranted not to
> change, ever?  And same for App Servers ?
>
>Regards,
>
>
>
___
General mailing list
General@developer.marklogic.com
http://developer.marklogic.com/mailman/listinfo/general


Re: [MarkLogic Dev General] Pointing to a database: using its ID?

2012-10-22 Thread Geert Josten
Hi Florent,

Might be worth to have a look at the configuration manager that comes with
MarkLogic since 5.0..

Kind regards,
Geert

> -Oorspronkelijk bericht-
> Van: general-boun...@developer.marklogic.com [mailto:general-
> boun...@developer.marklogic.com] Namens Florent Georges
> Verzonden: zondag 21 oktober 2012 21:14
> Aan: Michael Blakeley; MarkLogic Developer Discussion
> Onderwerp: Re: [MarkLogic Dev General] Pointing to a database: using its
ID?
>
> Michael Blakeley wrote:
>
>   Hi Michael,
>
> > The only problem with ids is that they are not portable.  So
> > the config file from one cluster won't work with another.  If
> > that's acceptable, then ids should be fine.
>
>   Good point, indeed.  But the scope is one MarkLogic Server
> instance (they are used only in the config file of a web
> application deployed on the instance, and they are not aimed at
> being sent to another instance), so it is fine then.
>
>   Thank you!
>
> --
> Florent Georges
> http://fgeorges.org/
> http://h2oconsulting.be/
> ___
> General mailing list
> General@developer.marklogic.com
> http://developer.marklogic.com/mailman/listinfo/general
___
General mailing list
General@developer.marklogic.com
http://developer.marklogic.com/mailman/listinfo/general


Re: [MarkLogic Dev General] Pointing to a database: using its ID?

2012-10-21 Thread Florent Georges
Michael Blakeley wrote:

  Hi Michael,

> The only problem with ids is that they are not portable.  So
> the config file from one cluster won't work with another.  If
> that's acceptable, then ids should be fine.

  Good point, indeed.  But the scope is one MarkLogic Server
instance (they are used only in the config file of a web
application deployed on the instance, and they are not aimed at
being sent to another instance), so it is fine then.

  Thank you!

-- 
Florent Georges
http://fgeorges.org/
http://h2oconsulting.be/
___
General mailing list
General@developer.marklogic.com
http://developer.marklogic.com/mailman/listinfo/general


Re: [MarkLogic Dev General] Pointing to a database: using its ID?

2012-10-21 Thread Florent Georges
John Snelson wrote:

> The IDs are globally unique and will not change for the lifetime
> of the  database or app server, so they seem ideal for your
> purposes.

  Yes they seem so.  Thank you John!


-- 
Florent Georges
http://fgeorges.org/
http://h2oconsulting.be/
___
General mailing list
General@developer.marklogic.com
http://developer.marklogic.com/mailman/listinfo/general


Re: [MarkLogic Dev General] Pointing to a database: using its ID?

2012-10-21 Thread Michael Blakeley
The only problem with ids is that they are not portable. So the config file 
from one cluster won't work with another. If that's acceptable, then ids should 
be fine.

-- Mike

On 21 Oct 2012, at 10:49 , Florent Georges  wrote:

>   Hi,
> 
>   For some configuration purpose, I have to point to databases
> from a config file.  Can I use the IDs of the databases, as
> returned by admin:get-database-ids()?  Are they guaranted not to
> change, ever?  And same for App Servers ?
> 
>   Regards,
>  
> 
> -- 
> Florent Georges
> http://fgeorges.org/
> http://h2oconsulting.be/
> ___
> General mailing list
> General@developer.marklogic.com
> http://developer.marklogic.com/mailman/listinfo/general
> 

___
General mailing list
General@developer.marklogic.com
http://developer.marklogic.com/mailman/listinfo/general


Re: [MarkLogic Dev General] Pointing to a database: using its ID?

2012-10-21 Thread John Snelson
Hi Florent,

On 21/10/12 18:49, Florent Georges wrote:
>For some configuration purpose, I have to point to databases
> from a config file.  Can I use the IDs of the databases, as
> returned by admin:get-database-ids()?  Are they guaranted not to
> change, ever?  And same for App Servers ?

The IDs are globally unique and will not change for the lifetime of the 
database or app server, so they seem ideal for your purposes.

John

-- 
John Snelson, Lead Engineerhttp://twitter.com/jpcs
MarkLogic Corporation http://www.marklogic.com
___
General mailing list
General@developer.marklogic.com
http://developer.marklogic.com/mailman/listinfo/general


[MarkLogic Dev General] Pointing to a database: using its ID?

2012-10-21 Thread Florent Georges
  Hi,

  For some configuration purpose, I have to point to databases
from a config file.  Can I use the IDs of the databases, as
returned by admin:get-database-ids()?  Are they guaranted not to
change, ever?  And same for App Servers ?

  Regards,
 

-- 
Florent Georges
http://fgeorges.org/
http://h2oconsulting.be/
___
General mailing list
General@developer.marklogic.com
http://developer.marklogic.com/mailman/listinfo/general