Class DerbyPersistenceManager

    • Field Detail

    • Constructor Detail

      • DerbyPersistenceManager

        public DerbyPersistenceManager()
    • Method Detail

      • setDerbyStorageInitialPages

        public void setDerbyStorageInitialPages​(String derbyStorageInitialPages)
        The on-disk size of a Derby table grows by one page at a time until eight pages of user data (or nine pages of total disk use, one is used for overhead) have been allocated. Then it will grow by eight pages at a time if possible.

        A Derby table or index can be created with a number of pages already pre-allocated. To do so, specify the property prior to the CREATE TABLE or CREATE INDEX statement.

        Define the number of user pages the table or index is to be created with. The purpose of this property is to preallocate a table or index of reasonable size if the user expects that a large amount of data will be inserted into the table or index. A table or index that has the pre-allocated pages will enjoy a small performance improvement over a table or index that has no pre-allocated pages when the data are loaded.

        The total desired size of the table or index should be

        ( * bytes.

        When you create a table or an index after setting this property, Derby attempts to preallocate the requested number of user pages. However, the operations do not fail even if they are unable to preallocate the requested number of pages, as long as they allocate at least one page.

        Default is 16

        derbyStorageInitialPages - the number of initial pages
      • setDerbyStorageMinimumRecordSize

        public void setDerbyStorageMinimumRecordSize​(String derbyStorageMinimumRecordSize)
        Indicates the minimum user row size in bytes for on-disk database pages for tables when you are creating a table. This property ensures that there is enough room for a row to grow on a page when updated without having to overflow. This is generally most useful for VARCHAR and VARCHAR FOR BIT DATA data types and for tables that are updated a lot, in which the rows start small and grow due to updates. Reserving the space at the time of insertion minimizes row overflow due to updates, but it can result in wasted space. Set the property prior to issuing the CREATE TABLE statement.

        Default is 256

        derbyStorageMinimumRecordSize - the minimum record size
      • setDerbyStoragePageCacheSize

        public void setDerbyStoragePageCacheSize​(String derbyStoragePageCacheSize)
        Defines the size, in number of pages, of the database's data page cache (data pages kept in memory). The actual amount of memory the page cache will use depends on the following: When increasing the size of the page cache, you typically have to allow more memory for the Java heap when starting the embedding application (taking into consideration, of course, the memory needs of the embedding application as well). For example, using the default page size of 4K, a page cache size of 2000 pages will require at least 8 MB of memory (and probably more, given the overhead).

        The minimum value is 40 pages. If you specify a lower value, Derby uses the default value.

        Default is 1024 (which gives about 16mb memory usage given the default of 16384 as page size).

        derbyStoragePageCacheSize - the page cache size
      • setDerbyStoragePageReservedSpace

        public void setDerbyStoragePageReservedSpace​(String derbyStoragePageReservedSpace)
        Defines the percentage of space reserved for updates on an on-disk database page for tables only (not indexes); indicates the percentage of space to keep free on a page when inserting. Leaving reserved space on a page can minimize row overflow (and the associated performance hit) during updates. Once a page has been filled up to the reserved-space threshold, no new rows are allowed on the page. This reserved space is used only for rows that increase in size when updated, not for new inserts. Set this property prior to issuing the CREATE TABLE statement.

        Regardless of the value of, an empty page always accepts at least one row.

        Default is 20%

        derbyStoragePageReservedSpace - the page reserved space
      • setDerbyStoragePageSize

        public void setDerbyStoragePageSize​(String derbyStoragePageSize)
        Defines the page size, in bytes, for on-disk database pages for tables or indexes used during table or index creation. Page size can only be one the following values: 4096, 8192, 16384, or 32768. Set this property prior to issuing the CREATE TABLE or CREATE INDEX statement. This value will be used for the lifetime of the newly created conglomerates.

        Default is 16384

        derbyStoragePageSize - the storage page size
      • init

        public void init​(PMContext context)
                  throws Exception
        Initializes the persistence manager. The persistence manager is permanently bound to the given context, and any required external resources are acquired.

        An appropriate exception is thrown if the persistence manager initialization fails for whatever reason. In this case the state of the persistence manager is undefined and the instance should be discarded. Initializes the internal structures of this abstract persistence manager.

        Specified by:
        init in interface PersistenceManager
        init in class BundleDbPersistenceManager
        context - persistence manager context
        Exception - if the persistence manager initialization failed