InfoQ

InfoQ

News

My Bookmarks

Login or Register to enable bookmarks for unlimited time.

The content has been bookmarked!

There was an error bookmarking this content! Please retry.

JNBridge Brings Distributed Transactions Across Java and .NET Code

Posted by Jonathan Allen on Dec 08, 2009

Sections
Architecture & Design,
Development,
Enterprise Architecture
Topics
Interop ,
.NET ,
Transactions Processing ,
Java
Tags
JNBridge

JNBridge is a technology that allows Java and .NET code to share objects without relying on cross-compilers. The Java code runs entirely on the JVM while .NET code runs on the CLR. Under this scheme, the JVM and CLR may be running on the separate machines, separate processes on the same machine, or even in the same process. From the developer’s perspective, objects running on the other virtual machine are merely proxied remote objects. JNBridge has a long history, with the first version becoming available back in June of 2002. Amongst its more prominent customers is Adobe’s ColdFusion, whose .NET support we first reported in 2007.

The new version of JNBridge brings the ability to easily distribute transactions across virtual machines. The key word here is easy, developers could always manually do the work necessary for two-phase commits. Using JNBridge 5.0, the necessary plumbing to hook into System.Transaction on the .NET side and javax.transaction on the Java side is taken care of for you. Aside from some configuration and a call to either JavaTM.enable or DotNetTM.enable, everything looks and behaves just like native transactions.

In order to use JNBridge, developers will need to become familiar with the proxy generation tool. This tool is available in both a standalone form and as a plug-in for Eclipse and Visual Studio. The Eclipse version is actually a testimony to the power of JNBridge, as it is actually written in .NET/WinForms.

The GUI hosting works both ways, with Java AWT and Swing components being embeddable within WinForms and WPF applications. This is used a lot by companies that have built up highly specialized controls such as molecular visualizers in Java and want to offer their technology to .NET developers without a massive porting effort.

Currently there are no plans to officially support Mono and Silverlight. While the underlying technologies needed by JNBridge are avaialble in Mono and Silverlight 4, developers are pretty much on their own when something goes wrong. By contrast, the supported platforms have extensive documentation.

No comments

Watch Thread Reply

Educational Content

New-age Transactional Systems - Not Your Grandpa's OLTP

John Hugg discusses high volume transaction processing applications with high and low frequency profiles, and how VoltDB can be used for that purpose.

Cool Code

Kevlin Henney examines code samples to see what can be learned from them starting from the premise that one won’t write great code unless he knows how to read it.

Collaboration: At the Extremities of Extreme

Jason Ayers share the observations he made watching a team of developers collaborating in real time on the same code base, pushing XP, pair programming and continuous integration to their extremes.

Yesod Web Framework

Michael Snoyman presents Yesod, a web framework written in Haskell and containing a web server, templating, ORM, libraries (templating, gravatar, etc.).

Transactions without Transactions

Richard Kreuter and Kyle Banker on how to avoid classical RDBMS transactional systems by using compensation mechanisms, transactional messaging or transactional procedures.

Attila Szegedi on JVM and GC Performance Tuning at Twitter

Attila Szegedi talks about performance tuning Java and Scala programs at Twitter: how to approach GC problems, the importance of asynchronous I/O, when to use MySQL/Cassandra/Redis, and much more.

10 tips on how to prevent business value risk

One category of risk that project teams need to ensure they address is business value failure – delivering a product that fails to provide value for the business investor.

Interview: Software Systems Architecture: Working With Stakeholders Using Viewpoints and Perspectives

InfoQ spoke to the authors of Software Systems Architecture on a couple of new topics, the System Context viewpoint and Agile, which have been added to the second edition.