GithubHelp home page GithubHelp logo

johnpoth / org.ops4j.pax.transx Goto Github PK

View Code? Open in Web Editor NEW

This project forked from ops4j/org.ops4j.pax.transx

0.0 3.0 0.0 315 KB

Transaction Manager and JMS / JDBC pooling support

License: Apache License 2.0

Java 100.00%

org.ops4j.pax.transx's Introduction

Pax TransX

Pax TransX aims at providing support for JTA/JTS transaction management in OSGi, along with resource pooling for JDBC and JMS.

This is the official source repository of the OPS4J Pax TransX project. Its licensed under the Apache Software License 2.0 by the OPS4J community.

Build

You'll need a machine with Java 8 and Apache Maven 3 installed.

Checkout:

git clone git://github.com/ops4j/org.ops4j.pax.transx.git

Run Build:

mvn clean install

Releases

The latest release is 0.1.0 and can be found in Maven Central.

Karaf Deployment

Pax-TransX provides features to easily integrate in Apache Karaf.

> repo-add mvn:org.ops4j.pax.transx/pax-transx-features/0.1.0/xml/features
> feature:install pax-transx-tm-narayana

Transaction Manager API

The TransX Transaction Manager API aims to provide a common facade for transaction managers so that one can code against various transaction managers without caring about the specifics. In addition to the basic transaction management capabilities, the API provides a facade for:

  • Recovery
  • Last Resource Commit

The Transaction Manager is the main entry point of the API.

Recovery

Transactional resources must be wrapped into ResourceFactories and registered in the Transaction Manager. This will trigger the recovery mechanism.

Last Resource Commit

If a transactional resource does not support XA, the XAResource wrapping this resource should also implement [LastResource]. Transaction managers that support LRC will ensure that such resources are prepared last, ensuring some consistency even with no native XA support.

Transaction Manager implementations

Pax TransX supports 3 different implementations based on the following transaction managers:

  • Geronimo
  • Narayana
  • Atomikos All three implementations supports recovery of inflight transactions, and Geronimo and Narayana transaction managers support Last-Resource-Commit.

JDBC

A JDBC DataSource with pooling and XA support can be created in the following way:

return ManagedDataSourceBuilder.builder()
        .transactionManager(tm)
        .name("h2invm")
        .dataSource(xaDataSource)
        .build();

JMS

A JMS ConnectionFactory with pooling an XA support can be created in the following way:

return ManagedConnectionFactoryBuilder.builder()
        .transactionManager(tm)
        .name("vmbroker")
        .connectionFactory(new ActiveMQConnectionFactory(brokerUrl),
                           new ActiveMQXAConnectionFactory(brokerUrl))
        .build();

Note that the wrapped ConnectionFactory will support JMS 2.0, only relying on JMS 1.1 for the underlying connection factories.

org.ops4j.pax.transx's People

Contributors

gnodet avatar graben avatar grgrzybek avatar tonit avatar

Watchers

James Cloos avatar John Poth avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.