To relax ACID property, ETM requires a
customized scheduling. In other words, it requires
adding specific semantics to scheduling. It is
necessary to set some flexible accessing roles on the
data items.
For example, in Flat model, if a data item is
modified by a transaction instance, then it can not be
accessed by any other instances until the holder
instance terminates (committed or rolled-back). The
accessing role is simple.
However, let’s look at the case of ETM. In
Nested model, after a child transaction instance
begins, it should be able to view the data items
which are locked by its parent instance. In this
example, the role is more complex: except the lock
holders, some instances (its children instances) are
allowed to view the data items, while some other
instances are not allowed to.
In conclusion, to implement various ETMs, the
transaction manager should provide a mechanism so
that the ETMs can set their necessary flexible
accessing roles.
2.2 J2EE Transaction Architecture
J2EE transaction service complies with JTS and JTA
specifications. Its architecture is coming from
CORBA OTS and X/Open DTP model.
In the architecture, clients (including stand-alone
Java Application and Session Bean) access the
underlying databases through the native database
interface, referred to as JDBC (Java Data Base
Connectivity) interface, while J2EE transaction
manager accesses the databases through
XAResource interface. Both interfaces are
implemented by the database vendors. Another way
client access database is entity bean. Entity bean is
an object-style encapsulation to the relational-data
from underlying database, and it is synchronized to
database through JDBC.
Figure1 shows the J2EE transaction service
architecture.
The XAResource interface is a simple java
mapping of X/Open XA interface. In essential, it is
just a set of functions.
According to JTS and JTA specification, J2EE
transaction manager is only responsible for
managing transaction identifiers and transaction
branches. The transaction manager performs its
work through the XAResource interface, such as
start(Xid), prepare(Xid), commit(Xid). J2EE
transaction manager is not aware of the detailed
accessed data and its concurrency control in the
underlying databases. And all of its work is just
issuing instructions to databases through
XAResource interface. i.e., the underlying database
is a black-box to J2EE transaction manager.
2.3 Discussion
Unfortunately, XAResource interface does not
include any functions to set the flexible accessing
roles. For example, J2EE transaction manager have
no way to inform the underlying database that a
child instance should inherit all locks of its parent
instance. It is also why the exiting research of ETM
in database can not be applied to J2EE directly. In
Data Base Management System (DBMS), we can
invoke lock manager to set the roles. However, as
mentioned above, we have no similar ability in
J2EE.
A straightforward way is to extend XAResource
interface so that it can pass any advanced
concurrency control instructions as we need.
However, it still can not work even we extend the
interface. Since in nowadays most commercial
databases only support Flat transaction model, and
do not support any advanced instructions. It is
meaningless to define an interface that few databases
can support it.
In conclusion, the difficulty of implementing
ETM in J2EE roots in the limitation of XAResource
interface and the underlying databases.
Some existing research was also troubled by this
obstacle. For example, in Bourgogne (Marek 2000),
a framework supports ETMs in J2EE, the system
provides an concurrency control instruction (called
primitive) delegate. The primitive is used to transfer
uncommitted data objects from one transaction
instance to another instance. However, since the
limitation mentioned above, there is no way to
inform databases the role. Thus the primitive
delegate can only be used between two transaction
branches with the same Xid. It is thought to be
difficult to break through this obstacle under the
current commercial databases (Marek 2002).
Figure 1: J2EE transaction service architecture.
A NEW APPROACH TO IMPLEMENT EXTENDED TRANSACTION MODELS IN J2EE
119