Java DB

Apache Derby

Derby Server and Administration Guide

Derby Getting Started
Derby Reference Manual
Derby Developer's Guide
Derby Performance Tuning
Derby Server and Admin Guide
Derby Tools and Utilities
Derby Server and Admin Guide
-Part one: Derby Server Guide
-Derby in a multi-user environment
-Using the Network Server with preexisting Derby applications
-The Network Server and JVMs
-Installing required jar files and adding them to the classpath
-Starting the Network Server
-Shutting down the Network Server
-Obtaining system information
-Accessing the Network Server by using the network client driver
-Accessing the Network Server by using a DataSource object
-XA and the Network Server
-Using the Derby tools with the Network Server
-Differences between running Derby in embedded mode and using the Network Server
-Setting port numbers
-Managing the Derby Network Server
-Managing the Derby Network Server remotely by using the servlet interface
-Derby Network Server advanced topics
-Derby Network Server sample programs
-Part two: Derby Administration Guide
-Checking database consistency
-Backing up and restoring databases
-Replicating databases
-Logging on a separate device
-Obtaining locking information
-Reclaiming unused space

 

Configuring the Network Server to handle connections

You can configure the Network Server to use a specific number of threads to handle connections. You can change the configuration on the command line or by using the servlet interface.

The minimum number of threads is the number of threads that are started when the Network Server is booted. This value is specified as a property, derby.drda.minThreads = <min>. The maximum number of threads is the maximum number of threads that will be used for connections. If more connections are active than there are threads available, the extra connections must wait until the next thread becomes available. Threads can become available after a specified time, which is checked only when a thread has finished processing a communication.

  • You can change the maximum number of threads by using the following command:
    java org.apache.derby.drda.NetworkServerControl maxthreads <max> [-h <hostname>] 
    [-p <portnumber>] 
    You can also use the derby.drda.maxThreads property to assign the maximum value. A <max> value of 0 means that there is no maximum and a new thread will be generated for a connection if there are no current threads available. This is the default. The <max> and <min> values are stored as integers, so the theoretical maximum is 2147483647 (the maximum size of an integer). But the practical maximum is determined by the machine configuration.
  • To change the time that a thread should work on one session's request and check if there are waiting sessions, use the following command:
    java org.apache.derby.drda.NetworkServerControl 
    timeslice <milliseconds> [-h <hostname>] [-p <portnumber>] 

    You can also use the derby.drda.timeSlice property to set this value. A value of 0 milliseconds indicates that the thread will not give up working on the session until the session ends. A value of -1 milliseconds indicates to use the default. The default value is 0. The maximum number of milliseconds that can be specified is 2147483647 (the maximum size of an integer).

 

javadb@jdbcurl.com