== Transaction Context

The only constraint imposed on a Context implementation is that it has
to implement the +java.io.Serializable+ interface. That's
because the TransactionManager has to write +snapshots+
of it at different check points.

You can use any +Serializable+ object, either a
custom object such as an application-specific _Bean_,
or a general-purpose object such as a +java.util.Map+
implementation (e.g., a +Hashmap+).

But we found it very useful to use a general-purpose context holding
two maps, a regular (persistent) map and a transient one, so that
one can store serializable data that can be automatically persisted
by the TransactionManager (for recovery purposes) as well as 'live'
references (such as a TCP/IP socket or a JDBC connection).

So there's a general purpose
link:http://jpos.org/doc/javadoc/org/jpos/transaction/Context.html[Context]
reference implementation that in addition implements the 
link:http://jpos.org/doc/javadoc/org/jpos/transaction/Pausable.html[Pausable]
interface, required if you plan to use transaction continuations (+PAUSE+
modifier).

This Context reference implementation has two kind of 'put' operations:

[source,java]
-------------
     public void put (Object key, Object value)
-------------

and

[source,java]
-------------
     public void put (Object key, Object value, boolean persist)
-------------

When using the latter, if +persist == true+, then the object can
get automatically persisted by the TransactionManager (if configured to
do so, using the +persistent-space+ property).


