Virtual Machine Object Retain Block for State Restoration
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
JAVA virtual machines lack the ability to restore an object's original state after an error occurs during application execution, leading to data corruption and inconsistencies.
Innovation Solution
Implementing an object retain block mechanism within the virtual machine, where the original state of objects is stored before potentially modifying instructions are executed, allowing for seamless return to the original state in case of errors.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Reliability
If Exceptions are used to detect and react to errors, then error detection capability is improved, but the ability to restore object state to before the error is lost
Solution Approach 1:
The patent stores the original state of objects in a retain block before executing potentially modifying instructions. This preliminary action preserves the original state information so that if an error occurs, the object can be restored to its previous state, thereby resolving the contradiction between error detection and state restoration capability
2Productivity
If object state is modified during instruction execution, then application functionality is improved, but data corruption and inconsistencies occur when errors happen
Solution Approach 1:
The patent implements a retain block that stores the original object state before potentially modifying instructions are executed. This beforehand cushioning mechanism ensures that if an error occurs during instruction execution, the original state is preserved and can be restored, preventing data corruption while allowing normal modification operations to proceed
3Device complexity
If no state restoration mechanism is implemented, then device complexity is reduced, but application consistency cannot be ensured after errors
Solution Approach 1:
The patent segments the application code into retain blocks that can be independently managed. Each retain block stores the original state of objects before potentially modifying instructions, allowing for targeted state restoration without requiring complex system-wide changes. This segmentation approach maintains application consistency while keeping the overall system structure relatively simple
Data Source
AI summary
A method for using a retain block in application code executing on a virtual machine includes identifying an instruction in application code, the instruction pertaining to an object, determining the instruction is part of a retain block, prior to executing the instruction, determining whether the instruction is to cause the object to be modified, and when the instruction is to cause the object to be modified, storing data indicating a first state of the object in a retain block store and causing the first state of the object to be modified using a second state. Also, the method includes in response to an error occurring during an execution of the instruction, returning the object from the second state to the first state using the stored data.


