osgi / bugzilla-archive

Archive of OSGi Alliance Specification Bugzilla bugs. The Specification Bugzilla system was decommissioned with the move to GitHub. The issues in this repository are imported from the Specification Bugzilla system for archival purposes.
0 stars 1 forks source link

[rfc 98] Transactions in OSGi #524

Closed bjhargrave closed 15 years ago

bjhargrave commented 16 years ago

Original bug ID: BZ#577 From: Pavlin Dobrev <p.dobrev@prosyst.com> Reported version: R4 V4.2

bjhargrave commented 16 years ago

Comment author: Pavlin Dobrev <p.dobrev@prosyst.com>

The MEG has created a number of services that have transactional needs but without implementing real transaction model. EEG also will need transaction behavior for its services. This RFC proposes to centralize the necessary signaling of transaction. The RFC argues for a limited transaction model that supports the use cases of an embedded and constrained environment. This implies no explicit crash recovery and a smaller API then the Java Transaction API

This RFC introduces the transaction concepts and outlines the different trade-offs that need to be made in the API.

Requirements Provide a comprehensive model that allows components in an OSGi Service Platform to perform their actions in a transaction way.

  1. Provide a set of APIs that define a Transaction Manager that can delineate transactions, commit, and rollback transactions together with a possibility for resource managers to join a transaction
  2. May provide centralized locking facility. (Current API doesn’t provide Locking mechanism. It is required that each resource participating in the transaction to define it’s own locking and isolation level).
  3. The transaction API must allow implementations to run on embedded systems
  4. There is no need for crash recovery because of its demand on fast persistent memory. This implies that a failure inside a transaction does not have to be recovered.
  5. The Transaction System may support a recovery concept, which allows the system to recover from power fails or accidental system shutdown.
  6. The API must be compatible with JTA as much as possible. This means that method names must be equal for equal cases so it is easy to reuse JTA implementations on an OSGi system. This allows developers, which are already familiar with the JTA to have the same experience using the OSGi transactional system, without the need of additional training. The similarity between these two APIs would also allow implementation of a transaction system that interoperates with the two models – the JTA and the OSGi transaction model.
  7. The model of the Transaction Manager must allow implementation of a transactional system, without modifying the existing API. As example a transaction-enabled CM implementation will still be compatible with the OSGi API, but will also participate in transaction started by the applications.
  8. The system must implements the four important features of the transactional system – ACID (Atomicity, Consistency, Isolation, Durability). This ensures that critical operations, executed within a transaction cannot break the stability and will leave the system in consistent state.
  9. In addition to the JTA, the OSGi Transactional model must provide isolation between the different components that participate in transaction, by allowing only the transaction owner to manage actively the state of the transaction. This is required because of the dynamic nature and various components that may exist in the OSGi environment.
  10. The transactional systems usually require more resources for proper operation. However, an embedded systems, which are one of the typical OSGi installations has a lot of resource constraints. Therefore, the API should allow the vendor to restring the access to the transactional system by a set of permissions, that allows only trusted components to start or participate in transactions.
bjhargrave commented 16 years ago

Comment author: @bjhargrave

CPEG call: Please review for discussion in next meeting.

bjhargrave commented 16 years ago

Comment author: @bjhargrave

CPEG call: Need simple mapping to existing transaction managers (written for JTA) and also JTA api. A section needs to be added to the RFC to discuss this.

Any use of transactions by the framework (as suggested in RFP 44) to manage sets of bundle lifecycle operations must be in a separate RFC.

bjhargrave commented 16 years ago

Comment author: @bjhargrave

CPEG call: Discussed the crash recovery issue.

One solution is to make crash recovery an optional feature

More discussion will be held at the f2f.

bjhargrave commented 16 years ago

Comment author: @tjwatson

Has commons transactions from apache been looked at? http://commons.apache.org/transaction/

Would this API be more acceptable for J2ME than JTA?

bjhargrave commented 16 years ago

Comment author: Roman Roelofsen <r.roelofsen@prosyst.com>

Has commons transactions from apache been looked at? http://commons.apache.org/transaction/

Would this API be more acceptable for J2ME than JTA?

It seems that the new version 2.0 is based on Java5 features e.g.

http://commons.apache.org/transaction/apidocs/org/apache/commons/transaction/locking/LockManager.html

and therefore not usable in current JavaME VMs.

Or do you suggest to use version 1.x?

bjhargrave commented 16 years ago

Comment author: @tjwatson

I noticed the 1.x version was compatible with JDK 1.2. But it looks like they overhauled the API in 2.0 to be more general. The 1.x version of the api looks like it is specific to transactional file systems and transactional collections. It may not be sufficient to for our needs.

bjhargrave commented 15 years ago

Comment author: @bjhargrave

CPEG mtg: RFC 98 is being handled by EEG.