Working with Cloudscape Properties
Page 4 of 4

Properties Case Study

Cloudscape allows you a lot of freedom in configuring your system. This freedom can be confusing if you do not understand how properties work. You also have the option of not setting any and instead using the Cloudscape defaults, which are tuned for a single-user embedded system.

Imagine the following scenario of an embedded environment:

Your system has a cloudscape.properties file, a text file that lives in the system directory, which you have created and named system_directory. Your databases also live in this directory. The properties file sets the following property:

  • cloudscape.storage.pageSize = 8192

You start up your application, being sure to set the cloudscape.system.home property appropriately:

java -Dcloudscape.system.home=c:\system_directory MyApp

You then create a new table:

CREATE TABLE table1
    (a INT,
    b VARCHAR(10))

Cloudscape takes the page size of 8192 from the system-wide properties set in the cloudscape.properties file, since the property has not been set any other way.

You shut down and then restart your application, setting the value of cloudscape.storage.pageSize to 4096 programmatically, as a parameter to the JVM command line:

java -Dcloudscape.system.home=c:\system_directory 
    -Dcloudscape.storage.pageSize=4096 myApp

You establish a connection to the database and set the value of the page size for all new tables to 1024 as a database-wide property:

CALL PropertyInfo.
    setDatabaseProperty(
    'cloudscape.storage.pageSize', '1024')

You then create two new tables, setting the page size for one of the specific tables in the CREATE TABLE statement:

CREATE TABLE table2
    (a INT,
    b VARCHAR(10))
PROPERTIES cloudscape.storage.pageSize=2048

CREATE TABLE table3
    (a INT,
    b VARCHAR(10))

In this scenario, Cloudscape uses the page size 2048 for the table table2, since conglomerate-specific properties always override system- and database-wide properties. Since no page size was set for table3, Cloudscape uses the system-wide property of 4096. The database-wide property of 1024 does not override a system-wide property set programmatically.

You shut down the application, then restart, this time forgetting to set the system-wide property programmatically (as a command-line option to the JVM):

java -Dcloudscape.system.home=c:\system_directory myApplication

You then create another table:

CREATE TABLE table4
    (a INT,
    b VARCHAR(10))

Cloudscape uses the persistent database-wide property of 1024 for this table, since the database-wide property set in the previous session is persistent and overrides the system-wide property set in the cloudscape.properties file.

What you have is a situation in which four different tables each get a different page size, even though the cloudscape.properties file remained constant.

Remove the cloudscape.properties file from the system or the database from its current location (forgetting to move the file with it), and you could get yet another value for a new table.

To avoid this situation, be consistent in the way you set properties.