Automatic Retry of Container-Managed Transactions

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Existing systems for managing transactions in EJB containers require explicit coding for retrying failed transactions, which is cumbersome and can lead to performance degradation, especially in concurrent environments where database deadlocks and optimistic concurrency exceptions occur.

Innovation Solution

Implementing automatic retry of container-managed transactions, allowing the EJB container to retry failed transactions up to a specified number of times without the need for explicit coding, either through deployment descriptors or runtime settings, thereby alleviating the burden on developers and improving performance by localizing retries within the same JVM.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Reliability

If explicit retry coding is implemented in EJB methods, then transaction reliability is improved, but device complexity and ease of operation deteriorate due to increased code burden and tedious source code

Engineering Contradiction:
Improvetransaction reliabilityVSAvoidcode complexity
Core Design Contradiction:
ReliabilityVSDevice complexity

Solution Approach 1:

The EJB container automatically performs transaction retries without requiring explicit retry logic in the EJB method code. The container monitors transaction outcomes and autonomously re-invokes the method when rollbacks occur, allowing the system to self-correct transaction failures without developer intervention in the retry mechanism.

Inventive Principle:
Principle #25Self-service

Solution Approach 2:

The EJB container acts as an intermediary between the EJB method and the transaction management system. It intercepts transaction outcomes, determines whether retries are necessary based on rollback exceptions, and coordinates re-invocations, thereby shielding the EJB method from complex retry logic while maintaining transaction reliability.

Inventive Principle:
Principle #24Intermediary (Mediator)

2Reliability

If explicit retry coding is implemented, then transaction reliability is improved, but productivity deteriorates due to performance degradation in remote network invocations

Engineering Contradiction:
Improvetransaction reliabilityVSAvoidtransaction processing speed
Core Design Contradiction:
ReliabilityVSProductivity

Solution Approach 1:

The container autonomously manages retry logic locally within the JVM, eliminating the need for remote network round-trips that would occur with explicit client-side retry coding. This local automation reduces network overhead and improves transaction processing speed while maintaining reliability.

Inventive Principle:
Principle #25Self-service

Solution Approach 2:

The retry logic is segmented from the EJB method implementation and placed in the container's transaction management layer. This separation allows the method itself to remain simple while the container handles the complex retry coordination, reducing overhead in remote invocations by managing retries at the container level rather than through repeated method invocations.

Inventive Principle:
Principle #1Segmentation

3Ease of operation

If automatic retry is implemented at the container level, then ease of operation is improved, but device complexity increases due to container configuration requirements

Engineering Contradiction:
Improvedeveloper ease of operationVSAvoidcontainer configuration complexity
Core Design Contradiction:
Ease of operationVSDevice complexity

Solution Approach 1:

The EJB container provides a universal retry mechanism that works across all EJB methods without requiring method-specific retry logic. By making retry functionality a general container capability rather than a method-specific feature, the system simplifies developer operations while the configuration complexity is centralized in the container's deployment descriptor rather than scattered throughout the codebase.

Inventive Principle:
Principle #6Universality (Multi-functionality)

4Reliability

If multiple retry attempts are allowed, then transaction reliability is improved, but loss of time increases due to additional retry cycles

Engineering Contradiction:
Improvetransaction success rateVSAvoidtransaction completion time
Core Design Contradiction:
ReliabilityVSLoss of time

Solution Approach 1:

The system implements a limited number of retry attempts (typically 1-3 retries) rather than unlimited retries. This partial action approach provides sufficient reliability improvement to handle transient failures like deadlocks and optimistic concurrency exceptions, while avoiding excessive time loss that would result from numerous retry cycles. The retry count is tuned to balance reliability gains against time consumption.

Inventive Principle:
Principle #16Partial or excessive action

Data Source

PatentUS7774780B2Systems and methods for automatic retry of transactions
Publication Date: 2010.08.10 ORACLE INT CORP
  • US7774780B2 patent drawing
  • US7774780B2 patent drawing
  • US7774780B2 patent drawing

AI summary

The feature of automatic retry of container-managed transactions configures the container to allow automatic retries of container-managed transactions that have been rolled back due to exceptions thrown at runtime. More specifically, on a per method basis, the container can be instructed to retry a failed transaction as using a new one up to a specified number of times if that method was the originator of the transaction that has been rolled back. The enabling of automatic transaction retries is accomplished either at deployment time by setting properties in the deployment descriptor of an instance of a class, such as EJB, or at runtime by setting properties on the EJB via a console on the application server. The automatic retry of container-managed transactions is a convenient feature that may alleviate the client of the task of explicitly coding transaction retries. In addition to programming convenience, retrying transactions using this feature may also offer performance benefits. This description is not intended to be a complete description of, or limit the scope of, the invention. Other features, aspects, and objects of the invention can be obtained from a review of the specification, the figures, and the claims.