Ask about the Context object!

Thursday, 31 May 2012 · 4 messages
TN
Truong An Nguyen31 May 2012 09:53 #
Hi, Can I use a Context object to create more than one database? For example:
new CreateDB("db1","c:\db1").execute(this.Context);
new CreateDB("db2","c:\db2").execute(this.Context);
Thanks. Cheers, An
CG
Christian Grün31 May 2012 11:01 #
Quoted text · Truong An Nguyen · 5 lines
> Can I use a Context object to create more than one database? > > For example: > new CreateDB("db1","c:\db1").execute(this.Context); > new CreateDB("db2","c:\db2").execute(this.Context);
Sure; the database you've created most recently will further be available as current "database context"; i.e., after having performed the two create commands, the following queries will yield the same result:
  new XQuery("db:open('db2')").execute(this.Context);
  new XQuery("/").execute(this.Context);
Christian
TN
Truong An Nguyen31 May 2012 11:12 #
Quoted text · Christian Grün · 1 line
>>Sure; the database you've created most recently will further be available
as current "database context<< I've created 2 database with the same context. After making changes to the first database, I exported the whole database, but I could not see the changes. I have no problem with the second database. Is the same context the reason? An On Thu, May 31, 2012 at 4:01 PM, Christian Grün <christian.gruen at gmail.com>wrote:
Quoted text · Christian Grün · 16 lines
> > Can I use a Context object to create more than one database? > > > > For example: > > new CreateDB("db1","c:\db1").execute(this.Context); > > new CreateDB("db2","c:\db2").execute(this.Context); > > Sure; the database you've created most recently will further be > available as current "database context"; i.e., after having performed > the two create commands, the following queries will yield the same > result: > > new XQuery("db:open('db2')").execute(this.Context); > new XQuery("/").execute(this.Context); > > Christian >
CG
Christian Grün31 May 2012 11:18 #
Quoted text · Truong An Nguyen · 4 lines
> I've created 2 database with the same context. After making changes to the > first database, I exported the whole database, but I could not see the > changes. I have no problem with the second database. Is the same context the > reason?
Do you have a working example that allows us to reproduce the issue? Christian

⚡Generated with XQuery