ExecuteDML
try {
- first modification               txn On
- ...
- MyEntityImpl.postChanges()‏
- txnStateChanged(false)   txn Off
Transaction Processing: Site Autonomy
ADF Swing Application
ADF Swing bindings
Web Service Data Source
execute();               txn On
commit();                txn Off
} catch (Exception x) {
rollback();
}
n Stateless web service completes every DML operation in
database (SOA “autonomy” and “loose coupling” principles)‏
n Client-side modification doesn't lock the row in database
n Client application uses ADF Swing bindings for managing transaction state
n Client application invokes commit by calling MyEntityImpl.postChanges() method
lock
Transaction Processing: Site Autonomy


Describing the web service, we have noticed that it is stateless. In case of DML operations, this means that each request determines completed transaction, and  the web service finishes its processing by commit or rollback depending on result of DML command in database.

Such behavior conforms to SOA principles of “autonomy” and “loose coupling” which declare service relationship with minimum dependencies and full service control over the encapsulated logic.

We've seen before that MyEntityImpl class which invokes DML requests to WSDS, overrides lock() method in super class. It's done to ignore row-lock request to database when client application makes first change in the row. As result, no transaction is started in database. Otherwise, web service should support transaction (or session) states between client requests.

ADF Swing framework provides client-side transaction status in the data binding objects. Transaction state methods are used for managing visual states of UI data-bound components. For example, buttons of JUNavigationBar object which control commit, rollback, insert and delete operations become enabled or disabled depending on current transaction state.

Client application invokes commit action by calling postChanges() method in MyEntityImpl object. For rollback action, the rowset can be simply refreshed from the database. In both cases, current transaction state should be changed to “off” by appropriate call to ADF bindings framework.