Hello,

as discussed here few monthes ago, I do this :
Install many instances (8) of BaseX on the same computer
Start one instance, here called "main-instance"
Create a database "library" , and load a filesystem directory into
"library"
Stop main-instance
For each "other-instance", create a sym-link to
main-instance/data/library
Start "other-instances"

On each instance, create 2 new databases "input" and "output", load a
file in "input", process it and store result in "output". The process
queries a lot "library", but never modifies "library". Then export
"output" and drop databases "input" and "output". I have about 100 files
to process; and I distribute them on the various instances

I had a first test environment, with only 4 isntances, and everything
was working perfectly.
Now, I'm working on target environment, a bigger computer with 8
instances. Process fails, at least one time per instance, so between 8
and 12 times on 100 process. The exception is 
java.lang.NullPointerException
        at org.basex.data.DiskData.write(DiskData.java:136)
        at org.basex.data.DiskData.close(DiskData.java:151)
        at org.basex.core.Datas.unpin(Datas.java:54)
        at org.basex.core.cmd.Close.close(Close.java:45)
        at org.basex.query.QueryResources.close(QueryResources.java:110)
        at org.basex.query.QueryContext.close(QueryContext.java:596)
        at org.basex.query.QueryProcessor.close(QueryProcessor.java:251)
        at org.basex.core.cmd.AQuery.query(AQuery.java:124)
        at org.basex.core.cmd.XQuery.run(XQuery.java:22)
        at org.basex.core.Command.run(Command.java:398)
        at org.basex.core.Command.execute(Command.java:100)
        at org.basex.server.ClientListener.run(ClientListener.java:136)

If I change the sym-links by a true copy (cp -r main/data/library
other/data/), it now works correctly, but the copy takes a long time
(database is about 30gb), and it consumes disk space. 
The computer I use has many available cores, and many RAM to use, so I'd
love to add other instance, many 16 more to reach 24 isntances, but if
database grow, I'm going to have disk-space troubles... 

1 - is it legal to share a database (and files) between many instances
as far as database is access read-only ? 
2 - is there a way to configure a database to be read-only ? 
3 - why symbolic links were perfectly usable with 4 instances, and do
not with 8 instances ?  (Hum I have to try symlinks with only 4
instances on the new computer...) 
4 - are there other specific things to check to do what I need ? 

Best regards, 
Christophe

Reply via email to