beautypg.com

What is spring tmf adapter – HP Integrity NonStop J-Series User Manual

Page 27

background image

As a shopper, you can perform the following activities (including those performed by a visitor):

Enter a username and password to access your account.

Store shipping information and preferences for your use at future sessions.

Purchase the items collected in a Cart.

Provide payment information.

Integrating Spring with Transaction Management Facility (TMF)

The NonStop Transaction Management Facility (TMF) provides transaction protection, database
consistency, and database recovery, which are critical in high-volume transaction processing.

TMF protects databases in a wide variety of environments such as online transaction processing
(OLTP), online query processing (OLQP), batch processing, and decision support systems.

TMF protects databases by managing database transactions, monitoring database activity through
the use of audit trails, and providing database recovery methods while sustaining high performance
in a high-volume, distributed application environment.

For more information, see the TMF Introduction manual and the TMF Reference Manual.

This section describes how to use a TMF Adapter in Spring application.

What is Spring TMF Adapter?

Spring provides the AbstractPlatformTransactionManager, which can be used to develop
a TMF adapter for Spring. Integration of NonStop TMF with Spring applications is provided by
implementing Spring's AbstractPlatformTransactionManager. The class used for this
implementation is called TmfTransactionManager. When TmfTransactionManager is used
in a Spring application, a transaction is started by using the Spring TMF adapter and creates a
TMF transaction on Nonstop.

TmfTransactionManager

exposes the following methods to Spring applications:

getTransaction

commit

rollback

NOTE:

For the actual signature of the methods mentioned above, see the Spring documentation

at

http://static.springsource.org/spring/docs/3.1.0.RELEASE/api/org/springframework/

transaction/PlatformTransactionManager.html

.

For information about TmfTransactionManager configuration, see

“Integrating Spring with

Transaction Management Facility (TMF)” (page 27)

.

The getTransaction method may be invoked with or without TMF transaction context. The behavior
of TmfTransaction will be based on the transaction propagation attribute set on it. The following
are the Propagation behaviors:

1.

PROPAGATION_REQUIRED: This is the default setting of a transaction definition, and typically
defines a transaction synchronization scope. If a transaction exists, it supports the current
transaction; otherwise, it creates a new one.

2.

PROPAGATION_SUPPORTS: Supports a current transaction; executes non-transactionally if no
transaction exists.

3.

PROPAGATION_MANDATORY: Supports a current transaction; if no transaction exists, throws
an exception.

4.

PROPAGATION_REQUIRES_NEW: Creates a new transaction; suspends the current transaction
if one exists.

5.

PROPAGATION_NOT_SUPPORTED: Does not support a current transaction; always executes
non-transactionally.

Integrating Spring with Transaction Management Facility (TMF)

27

This manual is related to the following products: