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

Related Topics: Weblogic

Weblogic: Article

Transactions, Commitmentand Security

Transactions, Commitmentand Security

I've seen several posts in the public WebLogic server transactions newsgroup in which people have had problems with transactions spread across multiple servers.

The gist of these problems is always that they have two EJB components in two different servers. Bean One on Server One executes in the context of a JTA transaction in which it calls Bean Two on Server Two, thus propagating the transaction across to the second server. Finally, the first method ends, and the transaction commits.

When the time to commit comes, the transaction is aborted. Accompanying the abort is a cryptic exception, javax.transaction.HeuristicMixedException. Since this comes up repeatedly, I thought I would dedicate this month's column to unravelling what's going on here.

First the euphemism: in the world of transactions, transaction managers don't like to sound too pessimistic, so if they think the world is coming to an end, they don't engage in unnecessary hyperbole, as it might upset the system administrators. Instead, they just quietly say that a heuristic outcome has occurred. That means that your carefully orchestrated ACID transaction has just ended with all the data potentially inconsistent, and you'd better go check your databases. Or, to put it another way, the world is at an end!

So with that explanation out of the way, let's think about what's happening here.

The call to Bean 1 has started a transaction that is associated with the thread of control and will propagate through to any database updates and the like that it performs. Then, it calls Bean 2. This will flow a request over to Server 2, where the second bean will be executed. Somehow, the transaction is being flowed over, accompanying the RMI request. Usually, server-to-server communication between WLS instances is done using the T3 protocol, and one of the things that can be achieved using T3 is the attaching of information about transactions to a request. So under the covers, the two WebLogic instances have exchanged notes about the transaction, and now both can participate, and at a later date commit or abort it as a single unit.

Allow Me to Digress...

At this point, a small digression is in order. The latest version of WLS, 7.0, is fully J2EE 1.3-certified, which mandates, among other things, support for EJB 2.0. This in turn mandates application server interoperability using RMI/IIOP. The IIOP protocol, like T3, allows context information such as active transactions to be passed along with method invocations. So, with WLS 7.0, this same scenario could be played out with one of the servers being a WLS instance and the other a different app server (although I don't know why you'd want one - but I'm biased!). Anyway, back to the plot...

Something I haven't mentioned so far in all of this is security. The client that initiated this request connected to Server 1 at some point using an InitialContext with a username and password. When the method on Bean 1 is invoked, the EJB container will check that the logged-in user is allowed to execute the method. Likewise, the EJB container on Server 2 will do the same check before it allows access to the method on Bean 2. This implies that the security ID associated with the request has also flowed over the wire, along with the transaction ID, and indeed it has. This is another capability of the T3 protocol. Incidentally, it's also another requirement of EJB 2.0 container interoperability - a protocol called CSIv2 is used to flow a user identifier over an IIOP connection and this too is supported by WLS 7.0.

The request has flowed from Server 1 to Server 2, along with the transaction and the caller's user ID, and it gets executed there and the result is returned. So far, so good. Now Bean 1 returns to the client and, if the transaction was container-managed, then the container will call commit. It is the job of the transaction co-coordinator (part of the JTA subsystem in Server 1 in this case) to synchronize the prepare and commit phases of this transaction. It will see that there is a participant on Server 2 and send a message to the server instructing it to perform the prepare phase of the two-phase commit protocol. It's at this point that the problems arise. This call isn't being done on behalf of the client, rather it is initiated by the JTA subsystem. What security ID will flow across the wire? In fact, it will be the WebLogic "system" user on whose behalf the prepare phase is executed. It would be a pretty serious security flaw if any Tom, Dick, or Harry could randomly prepare or commit transactions, so the use of the system ID closes this potential security hole. However, we now need to take a look at the security model underpinning WLS 6 (this area is another that has been substantially upgraded in WLS 7). In version 6, two servers will trust each other if they share the same system password. There is no greater degree of trust than trusting the system user, so for the prepare (and subsequent commit) phases to be allowed, the two servers must share a system password.

And Back to the News...
In conclusion, every time this has arisen on the newsgroup (remember, that's where this all started) the solution has been to make sure that all WLS instances that participate in a transaction share a common system password. Also note that transactions can happen that you're not aware of; for instance, if you send a message to a remote JMS queue, a transaction may well be started on your behalf by the JMS subsystem. Remember, next time you see a HeuristicMixedException, check your passwords!


  • WebLogic server transactions newsgroups:
http://newsgroups.bea.com/cgi-bin/dnewsweb?cmd= xover

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.

@ThingsExpo Stories
Dion Hinchcliffe is an internationally recognized digital expert, bestselling book author, frequent keynote speaker, analyst, futurist, and transformation expert based in Washington, DC. He is currently Chief Strategy Officer at the industry-leading digital strategy and online community solutions firm, 7Summits.
DXWordEXPO New York 2018, colocated with CloudEXPO New York 2018 will be held November 11-13, 2018, in New York City and will bring together Cloud Computing, FinTech and Blockchain, Digital Transformation, Big Data, Internet of Things, DevOps, AI, Machine Learning and WebRTC to one location.
Widespread fragmentation is stalling the growth of the IIoT and making it difficult for partners to work together. The number of software platforms, apps, hardware and connectivity standards is creating paralysis among businesses that are afraid of being locked into a solution. EdgeX Foundry is unifying the community around a common IoT edge framework and an ecosystem of interoperable components.
Cloud-enabled transformation has evolved from cost saving measure to business innovation strategy -- one that combines the cloud with cognitive capabilities to drive market disruption. Learn how you can achieve the insight and agility you need to gain a competitive advantage. Industry-acclaimed CTO and cloud expert, Shankar Kalyana presents. Only the most exceptional IBMers are appointed with the rare distinction of IBM Fellow, the highest technical honor in the company. Shankar has also receive...
Enterprises have taken advantage of IoT to achieve important revenue and cost advantages. What is less apparent is how incumbent enterprises operating at scale have, following success with IoT, built analytic, operations management and software development capabilities - ranging from autonomous vehicles to manageable robotics installations. They have embraced these capabilities as if they were Silicon Valley startups.
DXWorldEXPO LLC announced today that ICOHOLDER named "Media Sponsor" of Miami Blockchain Event by FinTechEXPO. ICOHOLDER give you detailed information and help the community to invest in the trusty projects. Miami Blockchain Event by FinTechEXPO has opened its Call for Papers. The two-day event will present 20 top Blockchain experts. All speaking inquiries which covers the following information can be submitted by email to [email protected] Miami Blockchain Event by FinTechEXPO also offers s...
Poor data quality and analytics drive down business value. In fact, Gartner estimated that the average financial impact of poor data quality on organizations is $9.7 million per year. But bad data is much more than a cost center. By eroding trust in information, analytics and the business decisions based on these, it is a serious impediment to digital transformation.
Predicting the future has never been more challenging - not because of the lack of data but because of the flood of ungoverned and risk laden information. Microsoft states that 2.5 exabytes of data are created every day. Expectations and reliance on data are being pushed to the limits, as demands around hybrid options continue to grow.
The standardization of container runtimes and images has sparked the creation of an almost overwhelming number of new open source projects that build on and otherwise work with these specifications. Of course, there's Kubernetes, which orchestrates and manages collections of containers. It was one of the first and best-known examples of projects that make containers truly useful for production use. However, more recently, the container ecosystem has truly exploded. A service mesh like Istio addr...
Digital Transformation: Preparing Cloud & IoT Security for the Age of Artificial Intelligence. As automation and artificial intelligence (AI) power solution development and delivery, many businesses need to build backend cloud capabilities. Well-poised organizations, marketing smart devices with AI and BlockChain capabilities prepare to refine compliance and regulatory capabilities in 2018. Volumes of health, financial, technical and privacy data, along with tightening compliance requirements by...
As IoT continues to increase momentum, so does the associated risk. Secure Device Lifecycle Management (DLM) is ranked as one of the most important technology areas of IoT. Driving this trend is the realization that secure support for IoT devices provides companies the ability to deliver high-quality, reliable, secure offerings faster, create new revenue streams, and reduce support costs, all while building a competitive advantage in their markets. In this session, we will use customer use cases...
Business professionals no longer wonder if they'll migrate to the cloud; it's now a matter of when. The cloud environment has proved to be a major force in transitioning to an agile business model that enables quick decisions and fast implementation that solidify customer relationships. And when the cloud is combined with the power of cognitive computing, it drives innovation and transformation that achieves astounding competitive advantage.
DevOpsSummit New York 2018, colocated with CloudEXPO | DXWorldEXPO New York 2018 will be held November 11-13, 2018, in New York City. Digital Transformation (DX) is a major focus with the introduction of DXWorldEXPO within the program. Successful transformation requires a laser focus on being data-driven and on using all the tools available that enable transformation if they plan to survive over the long term. A total of 88% of Fortune 500 companies from a generation ago are now out of bus...
Cloud Expo | DXWorld Expo have announced the conference tracks for Cloud Expo 2018. Cloud Expo will be held June 5-7, 2018, at the Javits Center in New York City, and November 6-8, 2018, at the Santa Clara Convention Center, Santa Clara, CA. Digital Transformation (DX) is a major focus with the introduction of DX Expo within the program. Successful transformation requires a laser focus on being data-driven and on using all the tools available that enable transformation if they plan to survive ov...
DXWorldEXPO | CloudEXPO are the world's most influential, independent events where Cloud Computing was coined and where technology buyers and vendors meet to experience and discuss the big picture of Digital Transformation and all of the strategies, tactics, and tools they need to realize their goals. Sponsors of DXWorldEXPO | CloudEXPO benefit from unmatched branding, profile building and lead generation opportunities.
Digital Transformation and Disruption, Amazon Style - What You Can Learn. Chris Kocher is a co-founder of Grey Heron, a management and strategic marketing consulting firm. He has 25+ years in both strategic and hands-on operating experience helping executives and investors build revenues and shareholder value. He has consulted with over 130 companies on innovating with new business models, product strategies and monetization. Chris has held management positions at HP and Symantec in addition to ...
With 10 simultaneous tracks, keynotes, general sessions and targeted breakout classes, @CloudEXPO and DXWorldEXPO are two of the most important technology events of the year. Since its launch over eight years ago, @CloudEXPO and DXWorldEXPO have presented a rock star faculty as well as showcased hundreds of sponsors and exhibitors! In this blog post, we provide 7 tips on how, as part of our world-class faculty, you can deliver one of the most popular sessions at our events. But before reading...
The best way to leverage your Cloud Expo presence as a sponsor and exhibitor is to plan your news announcements around our events. The press covering Cloud Expo and @ThingsExpo will have access to these releases and will amplify your news announcements. More than two dozen Cloud companies either set deals at our shows or have announced their mergers and acquisitions at Cloud Expo. Product announcements during our show provide your company with the most reach through our targeted audiences.
The IoT Will Grow: In what might be the most obvious prediction of the decade, the IoT will continue to expand next year, with more and more devices coming online every single day. What isn’t so obvious about this prediction: where that growth will occur. The retail, healthcare, and industrial/supply chain industries will likely see the greatest growth. Forrester Research has predicted the IoT will become “the backbone” of customer value as it continues to grow. It is no surprise that retail is ...
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...