Project

General

Profile

Database Configuration

Search Algorithm

The database nodes should commonly be provided with a full path:

  /server/<server_id>/database/<database_node>/..

where <server_id> is the name of the server, however if it's addressed with a relative path like:

database/<database_node>/..

the search will begin from the /server/<server_id> root and return the matching node.

Port Services Mappings

The port-services section maps a list of names to their TCP port numbers.

<node class="container" name="port_services">
   <node class="integer" name="my_first_service">
      <node-attribute name="value" value="3333"/>
   </node>
   <node class="integer" name="my_second_service">
      <node-attribute name="value" value="3343"/>
   </node>
</node>

This is used only by database connection setup.

Where Progress uses the services file to process services names to port mappings, FWD uses this data to create a logical connection to a database using the specified parameters.The Progress statement which defines this is the CONNECT statement, and it will always result in a call to the ConnectionManager.connect(...)

The CONNECT statement uses a series of parameters among which is :

-S { port-number | service-name }

This specifies the port number or service name used to connect to a FWD server running on the specified host. If the host is specified, then it is required to specify either the port or service name. In the case the argument is not a number the directory will be searched to find the port_services node that has the specified name.

Persistence

The persistence node of the directory controls whether persistence (i.e., database) support is active, and whether foreign keys are in use. By default, persistence support is active and foreign key support is disabled. Since it is unusual to change either of these defaults, this node is not present in the directory at all by default.

The active parameter controls whether runtime persistence support is turned on. It would be an uncommon ABL application which does not use a database at all, but persistence support can be disabled. This may be useful, for instance, when running simple test cases which do not use a database. The following setting under the standard/runtime/ directory path disables it:

<node class="container" name="persistence">
   <node class="boolean" name="active">
      <node-attribute name="value" value="FALSE"/>
   </node>
</node>

Note that when persistence is disabled, the FWD server will log a warning at startup.

The foreign-keys parameter controls whether the conversion will calculate and enforce referential integrity using “natural” joins. A natural join is one where two tables are linked by an exactly matching index specification which is defined as unique in at least one of the tables. The default value of foreign-keys parameter is FALSE.

This parameter is deprecated and should not be used. Traditionally, Progress code has not had any concept of referential integrity. This means that normal relational database management system (RDBMS) rules may be and probably are broken in most applications. As one example, in Progress the order of deletes between two tables is not important (it can be in any order), because Progress traditionally has not known about nor enforced any relationship between tables. When adding referential integrity where there was none in the past, such problems can cause a serious deadlocking bug. There are known issues with the current implementation of foreign keys such that many converted Progress applications would not work properly if this is enabled. Some of these problems can likely be resolved in the FWD runtime, but they do still exist at the time of this writing.

Example:

<node class="container" name="persistence">
   <node class="boolean" name="foreign-keys">
      <node-attribute name="value" value="FALSE"/>
   </node>
</node>

Permanent Databases

Connection

The connection container is used to set up a JDBC connection to the permanent database as configured in the specified directory. The common path the connection dir nodes have in common is:

 databaseDirNodePath + my_permanent_db + "/hibernate/connection/" 

where databaseDirNodePath is the full database container path from the directory file and the my_permanent_db variable represents the name of the permanent database.

The attributes of the connection container are:

  • username : (String) the user name used to connect to the database.
  • driver_class : (String) the Java Driver class used to create the JDBC Connection
  • password : (String) the password used to authenticate the user when connecting to the data base
  • url : (String) the jdbc url address of the database to which the connection is made
  • prepareThreshold (optional/Integer) : The threshold of number of times a statement is called for which the query will be used as a named query saving saving the execution plan at the database server

Example:

<node class="container" name="database">
 <node class="container" name="my_permanent_db">
   <node class="container" name="hibernate">
     <node class="container" name="connection">
       <node class="string" name="username">
         <node-attribute name="value" value="my_db_username"/>
       </node>
       <node class="string" name="driver_class">
         <node-attribute name="value" value="org.postgresql.Driver"/>
       </node>
       <node class="string" name="password">
         <node-attribute name="value" value="my_db_users_password_in_clear_text"/>
       </node>
       <node class="string" name="url">
         <node-attribute name="value" value="jdbc:postgresql://localhost/my_db_instance_name"/>
       </node>
       <node class="integer" name="prepareThreshold">
         <node-attribute name="value" value="1"/>
       </node>
     </node>
     ...

C3p0

The c3p0 section can be used to provide initialization data for c3p0 library.

C3p0 is an easy-to-use library for making traditional JDBC drivers "enterprise-ready" by augmenting them with functionality defined by the jdbc3 spec and the optional extensions to jdbc2. . In particular, c3p0 provides several useful services:

  • Classes which adapt traditional DriverManager-based JDBC drivers to the new javax.sql.DataSource scheme for acquiring database Connections.
  • Transparent pooling of Connection and PreparedStatements behind DataSources which can "wrap" around traditional drivers or arbitrary unpooled DataSources.

The attributes of the c3p0 container are:

  • max_statements (Integer) represents a JDBC's standard parameter for controlling statement pooling. It defines the total number PreparedStatements a DataSource will cache. The pool will destroy the least-recently-used PreparedStatement when it hits this limit.
  • idle_test_period ( Integer ) If this is a number greater than 0, c3p0 will test all idle, pooled but
  • aquire_increment (Integer) this parameter is used to determine how many connections at a time c3p0 will try to acquire when the pool is exhausted
  • max_size (Integer) this is used to set the maximum number of Connections a pool will maintain at any given time.
  • timeout (Integer) represents the number of milliseconds a client calling getConnection() will wait for a Connection to be checked-in or acquired when the pool is exhausted. Zero means wait indefin itely. Setting any positive value will cause the getConnection() call to time-out and break with an SQLException after the specified number of milliseconds.
  • validate (boolean) this parameter is used to decide if connections will be validated on on checkout or checking if true ( Hibernate 2.x only)
  • min_size (Integer) represents the minimum number of Connections a pool will maintain at any given time.

Example:

<node class="container" name="database">
 <node class="container" name="my_permanent_db">
   <node class="container" name="hibernate">
   ...
     <node class="container" name="c3p0">
       <node class="integer" name="max_statements">
         <node-attribute name="value" value="200"/>
       </node>
       <node class="integer" name="idle_test_period">
         <node-attribute name="value" value="300"/>
       </node>
       <node class="integer" name="acquire_increment">
         <node-attribute name="value" value="20"/>
       </node>
       <node class="integer" name="max_size">
         <node-attribute name="value" value="400"/>
       </node>
       <node class="integer" name="timeout">
         <node-attribute name="value" value="600"/>
       </node>
       <node class="boolean" name="validate">
         <node-attribute name="value" value="FALSE"/>
       </node>
       <node class="integer" name="min_size">
         <node-attribute name="value" value="20"/>
       </node>
     </node>
 ...

Hibernate Cache

Caching is all about application performance optimization and it sits between your application and the database to avoid the number of database hits as many as possible to give a better performance for performance critical applications.

The attributes of the cache container are:

  • use_second_level_cache ( boolean ) true to enable second level cache.

    Second level cache is an optional cache and first-level cache will always be consulted before any attempt is made to locate an object in the second-level cache. The second-level cache can be configured on a per-class and per-collection basis and mainly responsible for caching objects across sessions.
  • use_query_cache (boolean) true to enable query cache.

    The query cache effectively holds on to the identifiers for an individual query.

Example:

<node class="container" name="database">
 <node class="container" name="my_permanent_db">
   <node class="container" name="hibernate">
   ...
     <node class="container" name="cache">
       <node class="boolean" name="use_second_level_cache">
         <node-attribute name="value" value="TRUE"/>
       </node>
       <node class="boolean" name="use_query_cache">
         <node-attribute name="value" value="TRUE"/>
       </node>
     </node>
 ...

JDBC

This section is used for jdbc additional settings:

  • fetch_size (Integer) represents the number of rows physically retrieved from the database at one time by the JDBC driver as you scroll through a query ResultSet with next().

Example:

<node class="container" name="database">
 <node class="container" name="my_permanent_db">
   <node class="container" name="hibernate">
   ...
     <node class="container" name="jdbc">
       <node class="integer" name="fetch_size">
         <node-attribute name="value" value="1024"/>
       </node>
     </node>
  ...

Hibernate

Though hibernate container it's used to hold other containers it also has some attributes:

  • show_sql ( boolean) used to set enable the logging of all the generated SQL statements to the console
  • dialect ( String ) the java class that will be used to set hibernate dialect

Example:

<node class="container" name="database">
 <node class="container" name="my_permanent_db">
  <node class="container" name="hibernate">
   ...
    <node class="boolean" name="show_sql">
      <node-attribute name="value" value="FALSE"/>
    </node>
    <node class="string" name="dialect">
      <node-attribute name="value" value="com.goldencode.p2j.persist.dialect.P2JPostgreSQLDialect"/>
    </node>
   ...

FWD

This contains p2j core related attributes:

  • schema (String) represents the name of the schema database
  • load_at_startup (boolean) this used to determine auto-connect status ..
  • embedded-collation (String ) this is used to set collation rules. The value should be set to the string value en_US_FWD which currently is the only custom collation supported by FWD.
  • enable (boolean) enable p2j related services for the database.

FWD group contains also some subgroups:

  • warn_threshold/data_access(Container) this holds data used to configure various warning thresholds to trigger reporting of slow data access.
  • scroll_query (Integer) represents time in milliseconds a scrolling query may take before being reported
    • list_query (Integer) represents time in milliseconds a list query may take before being reported
    • load_by_id_query (Integer) represents time in milliseconds a load-by-id query may take before being reported
    • load_query (Integer) represents time in milliseconds a load query may take before being reported
  • lock_manager this is used to configure the record lock management.
    • dirty (Integer) the maximum time in milliseconds a record lock takes place without being reported as “dirty”

Example:

 <node class="container" name="database">
  <node class="container" name="my_permanent_db">
     ...
     <node class="container" name="p2j">
       <node class="string" name="schema">
         <node-attribute name="value" value="my_permanent_db"/>
       </node>
       <node class="boolean" name="load_at_startup">
         <node-attribute name="value" value="TRUE"/>
       </node>
       <node class="string" name="embedded-collation">
         <node-attribute name="value" value="en_US_FWD"/>
       </node>
       <node class="container" name="warn_threshold">
         <node class="container" name="data_access">
           <node class="integer" name="scroll_query">
             <node-attribute name="value" value="500"/>
           </node>
           <node class="integer" name="list_query">
             <node-attribute name="value" value="500"/>
           </node>
           <node class="integer" name="load_by_id_query">
             <node-attribute name="value" value="20"/>
           </node>
           <node class="integer" name="load_query">
             <node-attribute name="value" value="50"/>
           </node>
         </node>
         <node class="boolean" name="enable">
           <node-attribute name="value" value="FALSE"/>
         </node>
         <node class="container" name="lock_manager">
           <node class="integer" name="dirty">
             <node-attribute name="value" value="100"/>
           </node>
         </node>
       </node>
     </node>
    ...

Here is the full example of a permanent database configuration:

<node class="container" name="database">
 <node class="container" name="my_permanent_db">
   <node class="container" name="hibernate">
     <node class="container" name="connection">
       <node class="string" name="username">
         <node-attribute name="value" value="my_db_username"/>
       </node>
       <node class="string" name="driver_class">
         <node-attribute name="value" value="org.postgresql.Driver"/>
       </node>
       <node class="string" name="password">
         <node-attribute name="value" value="my_db_users_password_in_clear_text"/>
       </node>
       <node class="string" name="url">
         <node-attribute name="value" value="jdbc:postgresql://localhost/my_db_instance_name"/>
       </node>
       <node class="integer" name="prepareThreshold">
         <node-attribute name="value" value="1"/>
       </node>
     </node>
     <node class="container" name="c3p0">
       <node class="integer" name="max_statements">
         <node-attribute name="value" value="200"/>
       </node>
       <node class="integer" name="idle_test_period">
         <node-attribute name="value" value="300"/>
       </node>
       <node class="integer" name="acquire_increment">
         <node-attribute name="value" value="20"/>
       </node>
       <node class="integer" name="max_size">
         <node-attribute name="value" value="400"/>
       </node>
       <node class="integer" name="timeout">
         <node-attribute name="value" value="600"/>
       </node>
       <node class="boolean" name="validate">
         <node-attribute name="value" value="FALSE"/>
       </node>
       <node class="integer" name="min_size">
         <node-attribute name="value" value="20"/>
       </node>
     </node>
     <node class="container" name="cache">
       <node class="boolean" name="use_second_level_cache">
         <node-attribute name="value" value="TRUE"/>
       </node>
       <node class="boolean" name="use_query_cache">
         <node-attribute name="value" value="TRUE"/>
       </node>
     </node>
     <node class="boolean" name="show_sql">
       <node-attribute name="value" value="FALSE"/>
     </node>
     <node class="string" name="dialect">
       <node-attribute name="value" value="com.goldencode.p2j.persist.dialect.P2JPostgreSQLDialect"/>
     </node>
     <node class="container" name="jdbc">
       <node class="integer" name="fetch_size">
         <node-attribute name="value" value="1024"/>
       </node>
     </node>
   </node>
   <node class="container" name="p2j">
     <node class="string" name="schema">
       <node-attribute name="value" value="my_permanent_db"/>
     </node>
     <node class="boolean" name="load_at_startup">
       <node-attribute name="value" value="TRUE"/>
     </node>
     <node class="string" name="embedded-collation">
       <node-attribute name="value" value="en_US_FWD"/>
     </node>
     <node class="container" name="warn_threshold">
       <node class="container" name="data_access">
         <node class="integer" name="scroll_query">
           <node-attribute name="value" value="500"/>
         </node>
         <node class="integer" name="list_query">
           <node-attribute name="value" value="500"/>
         </node>
         <node class="integer" name="load_by_id_query">
           <node-attribute name="value" value="20"/>
         </node>
         <node class="integer" name="load_query">
           <node-attribute name="value" value="50"/>
         </node>
       </node>
       <node class="boolean" name="enable">
         <node-attribute name="value" value="FALSE"/>
       </node>
       <node class="container" name="lock_manager">
         <node class="integer" name="dirty">
           <node-attribute name="value" value="100"/>
         </node>
       </node>
     </node>
   </node>
 </node>
</node>

Temporary Tables

Connection

The attributes of the connection container are:

  • username : (String) the user name used to connect to the database.
  • driver_class : (String) the Java Driver class used to create the JDBC Connection
  • delegate_provider_class (String) the delegate provider Java class name
  • release_mode (String) used to instruct how a session should handle its JDBC connections.

    Possible values: auto, on_close, after_transaction, after_statement
  • password : (String) the password used to authenticate the user when connecting to the data base
  • url : (String) the jdbc url addres of the database to which the connection is made
  • provider_class (String) this represents the connection provider Java class name that ensures that a database connection used to create temp tables is preserved until the last temp table in use is dropped

Example:

<node class="container" name="database">
 <node class="container" name="_temp">
   <node class="container" name="hibernate">

     <node class="container" name="connection">
       <node class="string" name="username">
         <node-attribute name="value" value="my_temp_user_name"/>
       </node>
       <node class="string" name="driver_class">
         <node-attribute name="value" value="org.h2.Driver"/>
       </node>
       <node class="string" name="delegate_provider_class">
         <node-attribute name="value" value="com.goldencode.p2j.persist.UnpooledConnectionProvider"/>
       </node>
       <node class="string" name="release_mode">
         <node-attribute name="value" value="on_close"/>
       </node>
       <node class="string" name="password">
         <node-attribute name="value" value="my_temp_users_password_in_clear_text"/>
       </node>
       <node class="string" name="url">
         <node-attribute name="value" value="jdbc:h2:mem:_temp;DB_CLOSE_DELAY=-1;MULTI_THREADED=1"/>
       </node>

         <node-attribute name="value"<node class="string" name="provider_class"> value="com.goldencode.p2j.persist.TempTableConnectionProvider"/>
       </node>
     </node>
...

Hibernate Cache

Caching is all about application performance optimization and it sits between your application and the database to avoid the number of database hits as many as possible to give a better performance for performance critical applications.

The attributes of the cache container are:

  • use_second_level_cache ( boolean ) true to enable second level cache.

    Second level cache is an optional cache and first-level cache will always be consulted before any attempt is made to locate an object in the second-level cache. The second-level cache can be configured on a per-class and per-collection basis and mainly responsible for caching objects across sessions.
  • use_query_cache (boolean) true to enable query cache.

    The query cache effectively holds on to the identifiers for an individual query.

Example:

<node class="container" name="database">
  <node class="container" name="_temp">
   <node class="container" name="hibernate">
   ...
     <node class="container" name="cache">
       <node class="boolean" name="use_second_level_cache">
         <node-attribute name="value" value="TRUE"/>
       </node>
       <node class="boolean" name="use_query_cache">
         <node-attribute name="value" value="TRUE"/>
       </node>
     </node>
 ...

JDBC

This section is used for jdbc additional settings:

  • fetch_size (Integer) represents the number of rows physically retrieved from the database at one time by the JDBC driver as you scroll through a query ResultSet with next().

Example:

<node class="container" name="database">
  <node class="container" name="_temp">
   <node class="container" name="hibernate">
   ...
     <node class="container" name="jdbc">
       <node class="integer" name="fetch_size">
         <node-attribute name="value" value="256"/>
       </node>
     </node>
  ...

FWD

This contains p2j core related attributes:

  • schema (String) represents the name of the schema database
  • load_at_startup (boolean) this used to determine auto-connect status ..
  • embedded-collation (String ) this is used to set collation rules. The value should be set to the string value en_US_FWD which currently is the only custom collation supported by FWD.
  • enable (boolean)

FWD group contains also subgroups:

  • warn_threshold/data_access this holds data used to configure various warning thresholds to trigger reporting of slow data access.
    • scroll_query (Integer) represents time in milliseconds a scrolling query may take before being reported
    • list_query (Integer) represents time in milliseconds a list query may take before being reported
    • load_by_id_query (Integer) represents time in milliseconds a load-by-id query may take before being reported
    • load_query (Integer) represents time in milliseconds a load query may take before being reported
      Example:
<node class="container" name="database">
  <node class="container" name="_temp">
  ...
    <node class="container" name="p2j">
       <node class="string" name="schema">
         <node-attribute name="value" value="_temp"/>
       </node>
       <node class="boolean" name="load_at_startup">
         <node-attribute name="value" value="TRUE"/>
       </node>
       <node class="string" name="embedded-collation">
         <node-attribute name="value" value="en_US_FWD"/>
       </node>
       <node class="container" name="warn_threshold">
         <node class="container" name="data_access">
           <node class="integer" name="scroll_query">
             <node-attribute name="value" value="250"/>
           </node>
           <node class="integer" name="list_query">
             <node-attribute name="value" value="250"/>
           </node>
           <node class="integer" name="load_by_id_query">
             <node-attribute name="value" value="10"/>
           </node>
           <node class="integer" name="load_query">
             <node-attribute name="value" value="25"/>
           </node>
         </node>
         <node class="boolean" name="enable">
           <node-attribute name="value" value="FALSE"/>
         </node>
       </node>
     </node>
  ...
  </node>
</node>

Here is the full example of a temporary table configuration:

<node class="container" name="database">
 <node class="container" name="_temp">
   <node class="container" name="hibernate">
     <node class="container" name="connection">
       <node class="string" name="username">
         <node-attribute name="value" value="my_temp_user_name"/>
       </node>
       <node class="string" name="driver_class">
         <node-attribute name="value" value="org.h2.Driver"/>
       </node>
       <node class="string" name="delegate_provider_class">
         <node-attribute name="value" value="com.goldencode.p2j.persist.UnpooledConnectionProvider"/>
       </node>
       <node class="string" name="release_mode">
         <node-attribute name="value" value="on_close"/>
       </node>
       <node class="string" name="password">
         <node-attribute name="value" value="my_temp_users_password_in_clear_text"/>
       </node>
       <node class="string" name="url">
         <node-attribute name="value" value="jdbc:h2:mem:_temp;DB_CLOSE_DELAY=-1;MULTI_THREADED=1"/>
       </node>
       <node class="string" name="provider_class">
         <node-attribute name="value" value="com.goldencode.p2j.persist.TempTableConnectionProvider"/>
       </node>
     </node>
     <node class="container" name="cache">
       <node class="boolean" name="use_second_level_cache">
         <node-attribute name="value" value="FALSE"/>
       </node>
       <node class="boolean" name="use_query_cache">
         <node-attribute name="value" value="FALSE"/>
       </node>
     </node>
     <node class="boolean" name="show_sql">
       <node-attribute name="value" value="FALSE"/>
     </node>
     <node class="string" name="dialect">
       <node-attribute name="value" value="com.goldencode.p2j.persist.dialect.P2JH2Dialect"/>
     </node>
     <node class="container" name="jdbc">
       <node class="integer" name="fetch_size">
         <node-attribute name="value" value="256"/>
       </node>
     </node>
   </node>
   <node class="container" name="p2j">
     <node class="string" name="schema">
       <node-attribute name="value" value="_temp"/>
     </node>
     <node class="boolean" name="load_at_startup">
       <node-attribute name="value" value="TRUE"/>
     </node>
     <node class="string" name="embedded-collation">
       <node-attribute name="value" value="en_US_FWD"/>
     </node>
     <node class="container" name="warn_threshold">
       <node class="container" name="data_access">
         <node class="integer" name="scroll_query">
           <node-attribute name="value" value="250"/>
         </node>
         <node class="integer" name="list_query">
           <node-attribute name="value" value="250"/>
         </node>
         <node class="integer" name="load_by_id_query">
           <node-attribute name="value" value="10"/>
         </node>
         <node class="integer" name="load_query">
           <node-attribute name="value" value="25"/>
         </node>
       </node>
       <node class="boolean" name="enable">
         <node-attribute name="value" value="FALSE"/>
       </node>
     </node>
   </node>
 </node>
</node>

Schema Triggers

A database trigger is procedural code that is automatically executed in response to certain events on a particular table or view in a database. The trigger is mostly used for maintaining the integrity of the information on the database.

When a new trigger needs to be added to the directory, make sure the node under /database/<db_name>/p2j/schema/ schema_triggers/enable is set to true (where db_name can be teporary or permanent database).

Assign Trigger

The Assign Trigger container node who's name attribute is the Java trigger class name ( com.acme.myapp.triggers.MyAssignTrigger is given as an example ) represents the database trigger entity which will perform an action if any of the record fields specified (into the directory) is assigned a new value.

Assign trigger node container has the following attributes:

  • type (String) represents the type of trigger-> assign is the value for this kind of trigger
  • targets (Container) this will hold the DMOs on which the trigger will be applied.Here are the components:
    • DMO (Container)name of the DMO class for which the trigger will be applied (com.acme.myapp.dmo.my_permanent_db.SomeTable given as example).DMO properties:
      • properties (Strings) contains the list of DMO fields for which the trigger will be applied on value assigned
<node class="container" name="database">
 <node class="container" name="db_name">
 ...
   <node class="container" name="schema_triggers">
         <node class="boolean" name="enable">
           <node-attribute name="value" value="TRUE"/>
         </node>
         <node class="container" name="com.acme.myapp.triggers.MyAssignTrigger">
           <node class="string" name="type">
             <node-attribute name="value" value="assign"/>
           </node>
           <node class="container" name="targets">
             <node class="container" name="com.acme.myapp.dmo.my_permanent_db.SomeTable">
               <node class="strings" name="properties">
                 <node-attribute name="values" value="someField"/>
                 <node-attribute name="values" value="anotherField"/>
               </node>
             </node>
             <node class="container" name="com.acme.myapp.dmo.my_permanent_db.AnotherTable">
               <node class="strings" name="properties">
                 <node-attribute name="values" value="goodField"/>
                 <node-attribute name="values" value="badField"/>
                 <node-attribute name="values" value="uglyField"/>
               </node>
             </node>
           </node>
         </node>
   </node>
   ...

Delete Trigger

The Delete Trigger container node who's name attribute is the Java trigger class name ( com.acme.myapp.triggers.MyDeleteTrigger is given as an example ) represents the database trigger entity which will perform an action if any of the record rows specified (into the directory) is deleted.

Delete trigger node container has the following attributes:

  • type (String) represents the type of trigger-> assign is the value for this kind of trigger
  • targets (Container) this will hold the DMOs on which the trigger will be applied.Here are the components:
    • DMO (Container)name of the DMO class for which the trigger will be applied (com.acme.myapp.dmo.my_permanent_db.SomeTable etc. given as example).
<node class="container" name="database">
 <node class="container" name="db_name">
 ...
   <node class="container" name="schema_triggers">
   ...
      <node class="container" name="com.acme.myapp.triggers.MyDeleteTrigger">
           <node class="string" name="type">
             <node-attribute name="value" value="delete"/>
           </node>
           <node class="container" name="targets">
             <node class="container" name="com.acme.myapp.dmo.my_permanent_db.SomeTable"/>
             <node class="container" name="com.acme.myapp.dmo.my_permanent_db.AnotherTable"/>
             <node class="container" name="com.acme.myapp.dmo.my_permanent_db.SomeOtherTable"/>
           </node>
         </node>
       </node>
 ...

Full Database Trigger Example:

<node class="container" name="database">
 <node class="container" name="db_name">
 ...
   <node class="container" name="schema_triggers">
         <node class="boolean" name="enable">
           <node-attribute name="value" value="TRUE"/>
         </node>
         <node class="container" name="com.acme.myapp.triggers.MyAssignTrigger">
           <node class="string" name="type">
             <node-attribute name="value" value="assign"/>
           </node>
           <node class="container" name="targets">
             <node class="container" name="com.acme.myapp.dmo.my_permanent_db.SomeTable">
               <node class="strings" name="properties">
                 <node-attribute name="values" value="someField"/>
                 <node-attribute name="values" value="anotherField"/>
               </node>
             </node>
             <node class="container" name="com.acme.myapp.dmo.my_permanent_db.AnotherTable">
               <node class="strings" name="properties">
                 <node-attribute name="values" value="goodField"/>
                 <node-attribute name="values" value="badField"/>
                 <node-attribute name="values" value="uglyField"/>
               </node>
             </node>
           </node>
         </node>
         <node class="container" name="com.acme.myapp.triggers.MyDeleteTrigger">
           <node class="string" name="type">
             <node-attribute name="value" value="delete"/>
           </node>
           <node class="container" name="targets">
             <node class="container" name="com.acme.myapp.dmo.my_permanent_db.SomeTable"/>
             <node class="container" name="com.acme.myapp.dmo.my_permanent_db.AnotherTable"/>
             <node class="container" name="com.acme.myapp.dmo.my_permanent_db.SomeOtherTable"/>
           </node>
         </node>
       </node>
    ...

Reference

Here is the list of the related database options and their path you can set up inside the directory:

Option ID Data Type Default Value Required Details
/server/default/port_services/ <service_name> Integer N/A No FWD uses this data to create a logical connection to a database using the specified parameters. It can also be specified as parameters to server startup if not given inside directory
<db_path>/database/<db_name>/hibernate/connection/username String N/A Yes The username used to connect to the Database
<db_path>/database/<db_name>/hibernate/connection/diver_class String N/A Yes The Java Driver class used to create the JDBC Connection
<db_path>/database/<db_name>/hibernate/connection/password String N/A Yes The password used to connect to the Database
<db_path>/database/<db_name>/hibernate/connection/url String N/A Yes  
<db_path>/database/<db_name>/hibernate/connection/prepareThreshold Integer N/A No Th The threshold of number of times a statement is called for which the query will be used as a named query saving saving the execution plan at the database
<db_path>/database/<db_name>/hibernate/c3p0/max_statements Integer N/A Yes It defines the total number PreparedStatements a DataSource will cache. The pool will destroy the least-recently-used PreparedStatement when it hits this limit.
<db_path>/database/<db_name>/hibernate/c3p0/idle_test_period Integer N/A Yes If this is a number greater than 0, c3p0 will test all idle, pooled but unchecked connections, every this number of seconds
<db_path>/database/<db_name>/hibernate/c3p0/aquire_increment Integer N/A Yes This parameter is used to determine how many connections at a time c3p0 will try to acquire when the pool is exhausted
<db_path>/database/<db_name>/hibernate/c3p0/max_size Integer N/A Yes This is used to set the maximum number of Connections a pool will maintain at any given time.
<db_path>/database/<db_name>/hibernate/c3p0/timeout Integer N/A Yes Represents the number of milliseconds a client calling getConnection() will wait for a Connection to be checked-in or acquired when the pool is exhausted. Zero means wait indefin itely. Setting any positive value will cause the getConnection() call to time-out and break with an SQLException after the specified number of milliseconds.
<db_path>/database/<db_name>/hibernate/c3p0/validate boolean N/A Yes This parameter is used to decide if connections will be validated on on checkout or checking if true ( Hibernate 2.x only)
<db_path>/database/<db_name>/hibernate/c3p0/min_size Integer N/A Yes Represents the minimum number of connections a pool will maintain at any given time.
<db_path>/database/<db_name>/hibernate/cache/use_second_level_cache boolean false No True to enable second level cache.
Second level cache is an optional cache and first-level cache will always be consulted before any attempt is made to locate an object in the second-level cache. The second-level cache can be configured on a per-class and per-collection basis and mainly responsible for caching objects across sessions.
<db_path>/database/<db_name>/hibernate/cache/use_query_cache boolean false No True to enable query cache.
The query cache effectively holds on to the identifiers for an individual query
<db_path>/database/<db_name>/hibernate/jdbc/fetch_size Integer N/A Yes Represents the number of rows physically retrieved from the database at one time by the JDBC driver as you scroll through a query ResultSet with next().
<db_path>/database/<db_name>/hibernate/show_sql boolean false Yes Used to set enable/disable the logging of all the generated SQL statements to the console
<db_path>/database/<db_name>/hibernate/dialect String N/A Yes The java class that will be used to set hibernate dialect
<db_path>/database/<db_name>/p2j/schema String N/A Yes Represents the name of the schema database
<db_path>/database/<db_name>/p2j/load_at_startup boolean N/A Yes This is used to determine auto-connect status
<db_path>/database/<db_name>/p2j/embeded_collation String N/A Yes This is used to set collation rules. The value should be set to the string value en_US_FWD which currently is the only custom collation supported by FWD.
<db_path>/database/<db_name>/p2j/enable boolean N/A Yes Enable p2j related services for the database.
<db_path>/database/<db_name>/p2j/warn_threshold/data_access/scroll_query Integer N/A Yes Represents time in milliseconds a scrolling query may take before being reported
<db_path>/database/<db_name>/p2j/warn_threshold/data_access/list_query Integer N/A Yes Represents the time in milliseconds a list query may take before being reported
<db_path>/database/<db_name>/p2j/warn_threshold/data_access/load_by_id_query Integer   Yes Represents time in milliseconds a load-by-id query may take before being reported
<db_path>/database/<db_name>/p2j/warn_threshold/data_access/load_query Integer   Yes Represents time in milliseconds a load query may take before being reported
<db_path>/database/<db_name>/p2j/lock_manager Integer   Yes Represents the maximum time in milliseconds a record lock takes place without being reported as “dirty”
<db_path>/database/<db_name>/schema_triggers/<assign_triger_class_name>/type String assign/
delete
Yes Represents the type of the trigger (default is assign for Assign triggers and delete for delete triggers)
<db_path>/database/<db_name>/schema_triggers/<assign_triger_class_name>/targets/<DMO _class_name>/properties String List   Yes Contains the list of DMO fields for which the trigger will be applied on value assigned(this is used for assign triggers)
<db_path>/database/<db_name>/schema_triggers/<assign_triger_class_name>/targets/<DMO _class_name>   N/A Yes name of the DMO class for which the trigger will be applied (using it without properties node happends inside delete trigger)

© 2004-2017 Golden Code Development Corporation. ALL RIGHTS RESERVED.