Changes

Jump to navigation Jump to search
2,148 bytes added ,  17:37, 24 April 2017
This page is linked from the [[Getting Started]] Section.
The options listed on this page influence the way how database [[Commands|commands]] are executed and XQuery expressions are evaluated. Options are divided into [[#Global Options|'''global options''']], which are valid for all BaseX instances, and '''local options''', which are specific to a client or session. Values Two kinds of options are either ''strings'', ''numbers'' or ''booleans''.exist:
The {{Code|.basex}} * '''[[Configuration#Configuration FilesGlobal Options|configuration fileGlobal Options]] ''' are valid for all BaseX instances in the same JVM. This is parsed by every new local BaseX instanceparticularly relevant if you are working with the client/server architecture. It contains * '''Local options''' (all global options and, optionally, local options at the end of the fileremaining ones) are specific to a client or session.
Values of options are either ''strings'', ''numbers'' or ''booleans''. Options are ''static'' and not bound to a single operation (for example, the next command). Various ways exist to access and change options:
* The current value of an option can be requested with the {{Command|GET}} command. Local options can be changed via {{Command|SET}}. All values are ''static'': They stay valid until they are (all global options, except for {{Option|DEBUG}}, can only be changed once again by another operationat startup time). If an option is of type ''boolean'', and if no value is specified, its current value will be inverted. * The {{Code|.basex}} [[Configuration#Configuration Files|configuration file]] is parsed by every new local BaseX instance. It contains all global options. Local options can be specified at the end of the file after the {{Code|Local Options}} comment: <pre class="brush:perl"># General OptionsDEBUG = false... # Local OptionsCHOP = false</pre>
* Initial values for global options can also be specified via system properties, which can e.g. be passed on with the [http://docs.oracle.com/javase/1.4.2/docs/tooldocs/windows/java.html#options -D flag] on command line, or using [http://docs.oracle.com/javase/6/docs/api/java/lang/System.html#setProperty(java.lang.String,%20java.lang.String) System.setProperty()] before creating a BaseX instance. The specified keys need to be prefixed with {{Code|org.basex.}}. An example:
<string>-Dorg.basex.CHOP=false</string>
</array>
</pre>
 
* In a [[Web Application]], the default can be adjusted in the {{Code|web.xml}} file as follows:
 
<pre class="brush:xml">
<context-param>
<param-name>org.basex.chop</param-name>
<param-value>false</param-value>
</context-param>
</pre>
* In XQuery, local options can be set via option declarations and pragmas (see [[XQuery Extensions]]).
If options are implicitly changed by operations in the [[GUI]], the underlying commands will be listed in the [[GUI#Visualizations|Info View]].<br/><br/>
=Global Options=
===LOGPATH===
 
{{Mark|Updated with Version 8.5}}:
{| width='100%'
|}
===GLOBALLOCKFAIRLOCK=== {{Mark|Introduced with Version 8.6:}}
{| width='100%'
|-
| width='120' | '''Signature'''
|{{Code|GLOBALLOCK FAIRLOCK [boolean]}}
|-
| '''Default'''
|-
| '''Summary'''
|Controls Defines the locking strategy:* By default, non-fair is used. Read transactions will be favored, and transactions that access no databases can be evaluated even if local the limit of parallel transactions (database) or global specified via {{Option|PARALLEL}} has been reached. This prevents update operations from blocking all other requests (processfor example, the DBA can further be used to see which jobs are running, even if the queue is full) .* If fair locking is enabled, read and write transactions will be treated equally (first in, first out). This avoids starvation of update operations, and it should be used for managing read and write if the prompt evaluation of update operations. The article on [[Transaction Management]] provides more details on concurrency controlis critical.
|}
===CACHETIMEOUT===
 
{{Mark|Introduced with Version 8.5:}}
{| width='100%'
|-
| '''Summary'''
|Represents a password, which is used for accessing the server or an HTTP service:
* The default value will be overwritten if a client specifies its own credentials.
* If the default value is empty, login will only be possible if the client specifies credentials.
===AUTHMETHOD===
 
{{Mark|Updated with Version 8.5}}: {{Code|custom}} value added.
{| width='100%'
|-
| '''Summary'''
|Specifies the maximum time a read-only transaction triggered by a client may take. If an operation takes longer than the specified timeoutnumber of seconds, it will be aborted. Write Active update operations will not be affected by this timeout, as this would corrupt the integrity of the database. The timeout is deactivated if the timeout is set to {{Code|0}}. It is ignored for operations with [[User Management|admin permissions]].
|}
|}
===CACHERESTXQPARSERESTXQ=== {{Mark|Introduced with Version 8.6}}: replacing {{Code|CACHERESTXQ}}.
{| width='100%'
|-
| width='120' | '''Signature'''
|{{Code|CACHERESTXQPARSERESTXQ}}
|-
| '''Default'''
|{{Code|false3}}
|-
| '''Summary'''
|Caches [[Timeout after which the RESTXQ directory will be parsed for changes:* If {{Code|0}} is specified, the directory will be parsed every time a RESTXQ]] modules once when starting function is called.* A positive value defines the web applicationidle time in seconds after which parsing will be enforced.<br/>The option default value is helpful {{Code|3}}: Changes in productive environments with the RESTXQ directory will be detected after 3 seconds without RESTXQ function calls.* Monitoring is completely disabled if a high load, but files should not be replaced while the web server negative value is runningspecified. See [[RESTXQ#Preliminaries|RESTXQ Preliminaries]] for more details.
|}
|-
| '''Summary'''
|If this option is turned on, new databases will be exclusively created in main memory. :* Most queries will be evaluated faster in main -memory mode, but all data is lost if the BaseX instance in which the database was created is shut down. The value of this option * It is not possible to store binary resources in a main-memory database.* A main-memory database will be assigned once have no disk representation. However, it is possible to export the database via the {{Command|EXPORT}} command, and create a new databasefrom the exported file in a second step.* This option will not be available for [[Database Module#db:create|db:create]], and cannot because the database would not be changed accessible anymore after thatdatabase creation, i. e., outside the query scope.
|}
|-
| '''Summary'''
|Defines a [[Parsers|parser]] for importing new files to the database. Currently, 'XML', 'JSON', 'CSV', 'TEXT', 'HTML' are available as parsers. HTML will be parsed as normal XML files if [http://home.ccil.org/~cowan/XML/tagsoup/ [Parsers#HTML_Parser|Tagsoup]] is not found in the classpath.
|}
|-
| '''Summary'''
|Uses the internal XML parser instead of the standard Java XML parser. The Here are some reasons for using the internal parser is :* Performance: Documents (in particular small ones) will be parsed faster, more fault tolerant and supports common * Fault tolerance: invalid characters will automatically be replaced with the Unicode replacement character <code>FFFD</code> (&#xFFFD;)* Entities: around 250 HTML entities out-of-will be detected and decodedYou will be able to correctly parse most XML documents with the-boxinternal parser. Java’s Xerces parser is still used as default, but however, because it does not support supports all features needed for parsing DTDsof the XML standard and advanced DTD features, such as recursive entity expansion.
|}
XQUERY declare variable $GREETING external; $GREETING
</pre>
|}
 
===QUERYPATH===
 
{| width='100%'
|-
| width='120' | '''Signature'''
|{{Code|QUERYPATH [path]}}
|-
| '''Default'''
|''empty''
|-
| '''Summary'''
|Contains the path (''base URI'') to the executed query (default: ''empty''). This directory will be used to resolve relative paths to documents, query modules, and other resources addressed in a query.
|}
|-
| '''Summary'''
|This option controls inlining of XQuery functions:* The XQuery compiler inlines functions to speed up query evaluation. * Inlining will only take place if a function body is not too large (i.e., if it does not contain too many expressions). * With this option, this maximum number of expressions can be specified.<br/>* Function inlining can be turned off by setting the value to {{Code|0}}. * The limit can be locally overridden overwritten via the <code>[[XQuery_3.0XQuery Extensions#Annotationsbasex:inline|%basex:inline]]</code> annotation(follow the link to get more information on function inlining).
|}
=Changelog=
 
;Version 8.6
* Added: {{Option|FAIRLOCK}}, {{Option|PARSERESTXQ}}
* Removed: {{Code|GLOBALLOCK}} (exclusive use of database lock)
* Removed: {{Code|QUERYPATH}} (will now be internally assigned)
* Removed: {{Code|CACHERESTXQ}} (replaced with PARSERESTXQ)
;Version 8.5
* Added: {{Option|ASYNCTIMEOUTCACHETIMEOUT}}, {{Option|LOGPATH}}
* Updated: {{Option|AUTHMETHOD}}: {{Code|custom}} value added.
Bureaucrats, editor, reviewer, Administrators
13,550

edits

Navigation menu