[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
Example Summary
Property Detail
connection
Configured By | ELEMENT |
Access | WRITE_ONLY |
Required | Yes. |
The connection to use.
name
Configured By | ATTRIBUTE |
Access | READ_WRITE |
Required | No. |
The name.
persister
Access | READ_ONLY |
Required | R/O. |
The persister.
serializationFactory
Configured By | ELEMENT |
Access | READ_WRITE |
Required | No. |
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) Rob Gordon 2005 - 2017