On Thu, Jul 26, 2012 at 7:49 AM, Christian Grün christian.gruen@gmail.comwrote:
I have added a hint on that in the documentation. Apart from this page, there are several others indicating that a created database will automatically be opened; e.g.:
http://docs.basex.org/wiki/Standalone_Mode http://docs.basex.org/wiki/Database_Server
http://docs.basex.org/wiki/Database_Server#Create_a_new_database
says, for instance:
Create a new database
Now we will create another database from the xmark.xmlhttp://files.basex.org/xml/xmark.xml document.
- Create the new database, named 'xmark'.
CREATE DB http://docs.basex.org/wiki/Commands#CREATE_DATABASE xmark
xmark.xml
- Set the new database xmark as the context:
OPEN http://docs.basex.org/wiki/Commands#OPEN xmark
- Now you can easily execute queries on your new database:
XQUERY http://docs.basex.org/wiki/Commands#XQUERY //people/person/name
which to many would imply that a CREATE DB must be followed by an 'OPEN', or otherwise your use of the word 'now' doesn't make sense.
If you feel that the documentation is insufficient, it's easy to
contribute! You are invited to get an account.
Ok - you want your users to guess what weird design decisions you made, and document them. Unusual request.
On a more serious note, I'm wondering why? In our application, we have a connection pool that maintains multiple sessions to the BaseX server for load balancing purposes. This is a commonly used technique I know you're familiar with from SQL databases. With design decisions like yours that create per-session state as side-effects, you've just made this approach much more difficult to implement because each session now has to worry about how its activities might affect other sessions - even in applications where the current context is neither needed nor used.
My suggestion would be to rethink that decision and to not open the created database. If you must, provide a 'CREATE DB .... AND OPEN' command for use cases that need the db open after creation.
- Godmar