immutant.xa documentation
Distributed XA transactional support
datasource
(datasource id spec)
Create an XA-capable datasource named by 'id'. The result can be
associated with the :datasource key in a clojure.java.jdbc spec,
e.g.
(defonce ds (immutant.xa/datasource "myds" {...}))
(clojure.java.jdbc/with-connection {:datasource ds} ...)
The spec map keys are adapter-specific, but all should support the
following:
:adapter one of h2|oracle|mysql|postgres|mssql (required)
:host the host on which the database server is running [localhost]
:port the port on which the server is listening [adapter-specific]
:database the database name
:username the username for the database connection
:password the password associated with the username
:pool the maximum number of simultaneous connections used
:url a jdbc connection url (not supported by all adapters)
:subprotocol an alias for :adapter
:subname an alias for :database
:user an alias for :username
transaction
macro
(transaction & body)
Execute body within the current transaction, if available,
otherwise invoke body within a new transaction.
This is really just a convenient alias for
immutant.xa.transaction/required, which is the default behavior for
transactions in standard JEE containers. See the macros in
immutant.xa.transaction for finer-grained transactional control
corresponding to all the analogous attributes of the JEE @Transaction
annotation.
wrap
(wrap ds-or-spec)
Wrap a DataSource (or a spec from which a DataSource can be
obtained) with a reified DataSource that will ignore method calls
illegal on an XA Connection.