[Index]

sql-persister-service


Persists job state to a database. The database must have a table which can be created with the following sql.

 CREATE TABLE oddjob(
   path VARCHAR(128), 
   id VARCHAR(32), 
   job BLOB, 
  CONSTRAINT oddjob_pk PRIMARY KEY (path, id))
 

Property Summary

connection The connection to use.
name The name.
persister The persister.
serializationFactory A plugin for providers of the serialization.

Example Summary

Example 1 Using a SQL Persister.

Property Detail

connection

Configured ByELEMENT
AccessWRITE_ONLY
RequiredYes.

The connection to use.

name

Configured ByATTRIBUTE
AccessREAD_WRITE
RequiredNo.

The name.

persister

AccessREAD_ONLY
RequiredR/O.

The persister.

serializationFactory

Configured ByELEMENT
AccessREAD_WRITE
RequiredNo.

A plugin for providers of the serialization. The default is for HSQL.


Examples

Example 1

Using a SQL Persister.

<oddjob id="this">
    <job>
        <sequential>
            <jobs>
                <sql-persister-service id="sql-persister">
                    <connection>
                        <connection driver="org.hsqldb.jdbcDriver" url="jdbc:hsqldb:mem:test" username="sa"/>
                    </connection>
                </sql-persister-service>
                <oddjob id="oj" file="${this.dir}/SQLPersisterInner.xml">
                    <persister>
                        <value value="${sql-persister.persister(test)}"/>
                    </persister>
                </oddjob>
                <stop job="${sql-persister}"/>
            </jobs>
        </sequential>
    </job>
</oddjob>
Note that because this is a service, it must be stopped once the inner Oddjob has completed it's work. In an Oddjob that was running continually this would not be necessary.


(c) R Gordon Ltd 2005 - Present