Welcome!

Weblogic Authors: Yeshim Deniz, Elizabeth White, Michael Meiner, Michael Bushong, Avi Rosenthal

Related Topics: Weblogic

Weblogic: Article

Transactions: Driving You to Distraction?

Choose The Type 2 Driver To Help

One definition of a commodity is something that you take for granted.

I'll bet there aren't many readers out there who wake in the morning and exclaim, "Thank goodness there's air in the room to breathe!" Likewise, computer users will seldom give thanks for their operating systems, a proclamation like "praise be to those at AT&T and BSD for giving me Unix!" would likely raise more eyebrows than nods around an average water cooler. Things that are taken so much for granted are ripe for methods such as open source as provisioning mechanisms - at the end of the day, if its interfaces are well known and an implementation works "well enough" and is supported, then who cares if it was written in a garage or a high-tech lab? That's one of the reasons why I think the application server has some way to go before it commoditizes to the point where open source provides a realistic alternative as an underpinning to a business critical deployment - the application server market is small, and the capabilities offered by the market leading app. Servers are too rich (and the standards are evolving too quickly) for that to happen just yet a while.

But I digress (although I'm not sure if it's possible to digress before you have actually started...). This month's article is about a piece of technology that exists somewhere in the twilight zone between commodity and valuable asset - the humble JDBC driver.

One of the main drivers for the widespread adoption of the J2EE platform was the existence of standards that provide a good degree of plug-and-playability in terms of the resources accessing and accessed by the platform. One such principal resource is the SQL database (whose adoption in its own life cycle was fueled by the standard relational model for data access providing some swapability at a different layer of the architecture). The Java standard that makes SQL databases pluggable at this level is, of course, JDBC. At a brief glance, you may be wondering what I am going to write about next, apparently being on the verge of saying that the JDBC driver is yet another commodity, but actually, the truth is, especially in the context of XA transactions, all JDBC drivers were not created equal. My intent this month is to dig a bit deeper into this, and help answer two questions: What's the overhead of XA and what JDBC driver should I use to access my Oracle database in an XA transaction?

What's the Overhead of XA?
Quite a few years ago, when X/Open first created the XA standard, there were no commercial databases that supported it. Then came Oracle 7 (and the other RDBMS products of around the same vintage) and XA moved from nice theory to realistic deployment option and the distributed transaction was finally liberated from the mainframe to roam free across the world of open systems. In those days, it was not unreasonable advice to suggest that architects build all their services to access the database via XA. The performance overhead of XA was small (I dimly remember figures of 5% bandied about) and the 1pc optimization built into Tuxedo (and later brought forward into BEA WebLogic Server's transaction manager) meant that the 5% was all you paid, if you didn't need a distributed transaction for any particular use-case.

These days, the world has moved on, and this advice is in need of amendment - it turns out that with recent versions of Oracle, and Java in the picture, the overhead of accessing the database via XA is considerably more than 5% - some benchmarks put the degradation in throughput caused by using XA as high as 15x in the worst case (and note, this is not the overhead of two-phase commit, simply overhead introduced by the DBMS engine as a result of using xa_begin and xa_commit to delineate transactions).

Clearly, the prudent advice to anyone architecting a J2EE system is, at the very least, to benchmark your application using the XA configuration you need for production to ensure that your exact setup will give the throughput you require from your application, and be prepared to segment your database accesses into those that can use database local transactions and those that require XA for synchronisation with resources external to the database (for example, once and once only guaranteed message delivery from transactional message queues).

What JDBC Driver Should I Use to Access Oracle?
The JDBC standard provides for four different "types" of JDBC drivers. The important ones for this discussion are type 2 (in which the database is accessed via JNI calls from the java layer to Oracle's native OCI libraries) and type 4 (in which a pure Java driver implementation talks across a socket to a remote server, which accesses the database as a proxy for the client)

Looking at this from a "commodity component" perspective, the choice between the type 2 and type 4 drivers might be expected to be academic (with perhaps a slight preference for type 4, given that this doesn't require installation of the database native components on your application server box). This is by and large the case for non-XA database access; however, for XA access the story is somewhat different. In this case, the throughput of the type 2 drivers is somewhat better than that of their type 4 equivalents, but more pronounced is the effect on the database CPU - XA access via the type 4 driver causes dramatically increased CPU utilization on the database server relative to the type 2 equivalent.

So, What's the Conclusion?
As with all performance-type considerations, the main conclusion has to be that you should performance test an exact replica of your intended production configuration in order to determine that its performance will meet your needs. Any benchmark or other comparison of that kind is inherently heavily influenced by the usage patterns of the application, and also any benchmark is a snapshot in time of the state of the system - patches or new releases of the driver code (or the database engine itself) could completely change (hopefully for the better!) the results of any comparison.

However, with the technology where it is today, it seems safe to conclude that you should try to stick to the type 2 driver for XA database access, unless you have a pretty compelling reason to do otherwise.

More Stories By Peter Holditch

Peter Holditch is a senior presales engineer in the UK for Azul Systems. Prior to joining Azul he spent nine years at BEA systems, going from being one of their first Professional Services consultants in Europe and finishing up as a principal presales engineer. He has an R&D background (originally having worked on BEA's Tuxedo product) and his technical interests are in high-throughput transaction systems. "Of the pitch" Peter likes to brew beer, build furniture, and undertake other ludicrously ambitious projects - but (generally) not all at the same time!

Comments (0)

Share your thoughts on this story.

Add your comment
You must be signed in to add a comment. Sign-in | Register

In accordance with our Comment Policy, we encourage comments that are on topic, relevant and to-the-point. We will remove comments that include profanity, personal attacks, racial slurs, threats of violence, or other inappropriate material that violates our Terms and Conditions, and will block users who make repeated violations. We ask all readers to expect diversity of opinion and to treat one another with dignity and respect.


IoT & Smart Cities Stories
Dynatrace is an application performance management software company with products for the information technology departments and digital business owners of medium and large businesses. Building the Future of Monitoring with Artificial Intelligence. Today we can collect lots and lots of performance data. We build beautiful dashboards and even have fancy query languages to access and transform the data. Still performance data is a secret language only a couple of people understand. The more busine...
Nicolas Fierro is CEO of MIMIR Blockchain Solutions. He is a programmer, technologist, and operations dev who has worked with Ethereum and blockchain since 2014. His knowledge in blockchain dates to when he performed dev ops services to the Ethereum Foundation as one the privileged few developers to work with the original core team in Switzerland.
René Bostic is the Technical VP of the IBM Cloud Unit in North America. Enjoying her career with IBM during the modern millennial technological era, she is an expert in cloud computing, DevOps and emerging cloud technologies such as Blockchain. Her strengths and core competencies include a proven record of accomplishments in consensus building at all levels to assess, plan, and implement enterprise and cloud computing solutions. René is a member of the Society of Women Engineers (SWE) and a m...
Andrew Keys is Co-Founder of ConsenSys Enterprise. He comes to ConsenSys Enterprise with capital markets, technology and entrepreneurial experience. Previously, he worked for UBS investment bank in equities analysis. Later, he was responsible for the creation and distribution of life settlement products to hedge funds and investment banks. After, he co-founded a revenue cycle management company where he learned about Bitcoin and eventually Ethereal. Andrew's role at ConsenSys Enterprise is a mul...
Whenever a new technology hits the high points of hype, everyone starts talking about it like it will solve all their business problems. Blockchain is one of those technologies. According to Gartner's latest report on the hype cycle of emerging technologies, blockchain has just passed the peak of their hype cycle curve. If you read the news articles about it, one would think it has taken over the technology world. No disruptive technology is without its challenges and potential impediments t...
If a machine can invent, does this mean the end of the patent system as we know it? The patent system, both in the US and Europe, allows companies to protect their inventions and helps foster innovation. However, Artificial Intelligence (AI) could be set to disrupt the patent system as we know it. This talk will examine how AI may change the patent landscape in the years to come. Furthermore, ways in which companies can best protect their AI related inventions will be examined from both a US and...
In his general session at 19th Cloud Expo, Manish Dixit, VP of Product and Engineering at Dice, discussed how Dice leverages data insights and tools to help both tech professionals and recruiters better understand how skills relate to each other and which skills are in high demand using interactive visualizations and salary indicator tools to maximize earning potential. Manish Dixit is VP of Product and Engineering at Dice. As the leader of the Product, Engineering and Data Sciences team at D...
Bill Schmarzo, Tech Chair of "Big Data | Analytics" of upcoming CloudEXPO | DXWorldEXPO New York (November 12-13, 2018, New York City) today announced the outline and schedule of the track. "The track has been designed in experience/degree order," said Schmarzo. "So, that folks who attend the entire track can leave the conference with some of the skills necessary to get their work done when they get back to their offices. It actually ties back to some work that I'm doing at the University of San...
When talking IoT we often focus on the devices, the sensors, the hardware itself. The new smart appliances, the new smart or self-driving cars (which are amalgamations of many ‘things'). When we are looking at the world of IoT, we should take a step back, look at the big picture. What value are these devices providing. IoT is not about the devices, its about the data consumed and generated. The devices are tools, mechanisms, conduits. This paper discusses the considerations when dealing with the...
Bill Schmarzo, author of "Big Data: Understanding How Data Powers Big Business" and "Big Data MBA: Driving Business Strategies with Data Science," is responsible for setting the strategy and defining the Big Data service offerings and capabilities for EMC Global Services Big Data Practice. As the CTO for the Big Data Practice, he is responsible for working with organizations to help them identify where and how to start their big data journeys. He's written several white papers, is an avid blogge...