Hi Jason,

it worked for me, but i figured out one more solution.

Create two folders with BaseX.jar, .basex, .basexperm in it.
Write in the two .basex files the directory you like to have as database path.
Start the two servers with their different ports. No more database path change is necessary.
That worked for me, too. :-)

I hope that works now,
kind regards, Andreas

Am 16.05.2011 um 20:13 schrieb Jason Klassen:

Hi Andreas,
 
Thanks for the prompt response. 
 
I tried your solution in both BaseX 6.6 and 6.6.2 without luck.  I am running Windows 7 64 bit, not sure if the OS will be causing a difference.   What I’ve noticed is that the setting in the .basex file is still used no matter what.  I unpacked 6.6.2 to a clean BaseXUI directory and this is what I see.
 
1.       .basex file in the root c:\BaseXUI directory has a setting for DBPATH = BaseXDummyData
a.       I’m using relative paths to limit variables
b.      If I don’t have a .basex in the root directory with BaseX.jar then the server will default to a .basex in the c:\Users\jklassen directory.  If the .basex in the c:\Users\jklassen directory is missing it will create a .basex file with defaults and use that.
2.       Run C:\BaseXUI>java -cp BaseX.jar org.basex.BaseXServer -p1985 -c"set dbpath BaseXData;info"
a.       Output states Database Path: BaseXData
b.      However a new directory called BaseXDummyData is created… based on the parameters BaseXData should have been created
c.       BaseXDummyData is locked and in use as long as the basex server prompt is running which indicates this is the one the process is latched onto
3.       Read attempts go against BaseXDummyData  and new databases are created in BaseXDummyData not BaseXData
 
Any suggestions?
 
Jason
 
From: Andreas Weiler [mailto:andreas.weiler@uni-konstanz.de] 
Sent: May-14-11 2:15 AM
To: Jason Klassen
Cc: basex-talk@mailman.uni-konstanz.de; Jennifer Violago
Subject: Re: [basex-talk] BaseXServer.bat not respecting the -c"SET DBPATH ..." option?
 
Hi Jason,
 
i just tried to solve your problem by using the BaseX.jar.
The following works for me:
 
First server:
java -cp BaseX.jar org.basex.BaseXServer -p1984 -c"set dbpath /Users/test/Desktop/BaseXData1"
 
Second server:
java -cp BaseX.jar org.basex.BaseXServer -p1985 -c"set dbpath /Users/test/Desktop/BaseXData2"
 
Kind regards,
Andreas
 
Am 13.05.2011 um 23:09 schrieb Jason Klassen:


I’m trying to run a BaseX Server and have it read data from a different directory than the default.  So I add the flag -c"SET DBPATH C:/Working/BaseXData;info".  To make sure that no previous settings are corrupting it I renamed the old .basex file to something else so it wouldn’t find it.   The info shows me the Database Path is correct.
 
C:\Working>C:\basex\bin\basexserver -p1985 -c"SET DBPATH C:/Working/BaseXData;info"
Saving properties in "C:\Users\jklassen/.basex"...
BaseX 6.6 [Server]
Server was started.
General Information
Database Path: C:/Working/BaseXData
Used Main Memory: 1154 KB
 
Database Creation
Whitespace Chopping: ON
Entity Parsing: OFF
 
Indexes
Path Summary: ON
Text Index: ON
Attribute Index: ON
Full-Text Index: OFF
 
Upon running basexserver a new .basex file is created.  The contents of my .basex file are
 
# Property File.
# You can set additional options at the end of the file.
 
DBPATH = C:\Users\jklassen/BaseXData
JAXRXPATH = C:\Users\jklassen/BaseXWeb
LANG = English
LANGKEYS = false
HOST = localhost
PORT = 1984
SERVERPORT = 1984
JAXRXPORT = 8984
TIMEOUT = 0
 
# User defined section
 
You can see that it created the file using the default windows directory. (I’m on windows 7).  I would be fine with it except for the fact that no matter what I specify in SET DBPATH the server is only accessing the default C:\Users\jklassen/BaseXData folder.  It does correctly initiate on the 1985 port.
 
If I change the file to read
 
# Property File.
# You can set additional options at the end of the file.
 
DBPATH = C:/Working/BaseXData
JAXRXPATH = C:\Users\jklassen/BaseXWeb
LANG = English
LANGKEYS = false
HOST = localhost
PORT = 1984
SERVERPORT = 1984
JAXRXPORT = 8984
TIMEOUT = 0
 
# User defined section
 
It works and finds the data in the right directory.   If I add the flag -c"SET DBPATH C:/FakeDirectory/BaseXData;info" it still works, even though the info shows the new database path, leading me to believe it’s ignoring the command.
 
The problem for me lies in the fact that I want two BaseX Servers running on the same machine. One on port 1984 for my backend app and one on port 1985 for my web app and I’d like them to use separate file directories.  Is SET DBPATH the right way to accomplish this?
 
________________________________

Jason Klassen

Protegra
   Business. Technology. Solutions.

Office:   204-272-2290
www.protegra.com

 
_______________________________________________
BaseX-Talk mailing list
BaseX-Talk@mailman.uni-konstanz.de
https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk