Hello all,


I just faced an issue in my application using BaseX 8.6.4 when trying to
create a user.


If the folder that will contain the databases (DBPATH in .basex
configuration file) does not exist when you try to create a user, the
creation of the “users.xml” file fails.

To reproduce, make sure that the folder defined by DBPATH does not exist,
and execute:


final Context ctx = new Context();

try (final Session session = new LocalSession(ctx);) {

   session.execute(new CreateUser("USERNAME", "USERPASSWORD"));

}


Then nothing happens. The users.xml file is not created.

While executing this:


final Context ctx = new Context();

try (final Session session = new LocalSession(ctx);) {

    session.execute(new CreateDB("TESTDB"));

    session.execute(new CreateUser("USERNAME", "USERPASSWORD"));

}


Works as expected as the CreateDB() command will create the missing folder.



Is it on purpose or was it overlooked?



Best regards


Simon Chatelain

Reply via email to