JOB Factory

JOB factories are entry points for applications accessing persistent objects. Factory instances are used to create JOB sessions which establish connections to JOB instances. JOB instances are transparent for applications. They are identified by URLs. Session semantics is controlled by the following properties:

  • URL,
  • user,
  • password,
  • isolation level,
  • optimistic transaction mode,
  • encoding.

Some properties are required, such as URL, user, password. These properties control authorized access to JOB instances. The other properties are optional. Session instances are created for a set of these properties by either supplying primitive values or optionally, supplying a JDK map instance to methods creating sessions. Valid property keys and values are as static fields defined for this purpose.

The URL format is:

  • file:<directory> for embedded server mode,
  • job://<host>[:<port>] for client/server mode.

You can create as many sessions as needed by your application. For this purpose use the following method

    JobSession newSession(String url, String user, String password)

Optionally, you may call overloaded methods passing properties as parameters:

    JobSession newSession(String url, String user, String password,
                          String isolationLevel, boolean optimistic)

Or, you can assign properties to sessions using a Java Properties instance:

    JobSession newSession(Properties properties)

Java Properties instances must contain required properties. Additionally, it may contain optional properties. The following table shows all session properties. Optional properties are assigned default values by the implementation if they are specified explicitly.

Parameter Type Required Default Description
org.job.url String Yes
A valid JOB URL, e.g. file:<directory> for embedded server mode, or job://<host>[:<port>] for client server mode.
org.job.user String Yes
A valid JOB user. There are two predefined JOB users:
  • An admin user (name: "JOB", password: "Admin"),
  • a non-admin user (name: "rio", password: "dejaneiro").
org.job.password String Yes
The password for a valid JOB user.
org.job.isolationLevel String No "Commited Read" Default isolation level of transactions, one of
  • "Serializable" ,
  • "Repeatable Read" ,
  • "Commited Read" ,
  • "Dirty Read" .
org.job.optimistic Boolean No true If true transactions run in optimistic mode.
org.job.encoding String No "" Supported values are given by Java standard character sets. Consult the release documentation for your implementation to see if any other charsets are supported. The empty string defaults to unicode encoding.