US20080134182A1 - Computer readable storage medium for protection against interleaving transactions using a transaction manager - Google Patents

Computer readable storage medium for protection against interleaving transactions using a transaction manager Download PDF

Info

Publication number
US20080134182A1
US20080134182A1 US12/030,681 US3068108A US2008134182A1 US 20080134182 A1 US20080134182 A1 US 20080134182A1 US 3068108 A US3068108 A US 3068108A US 2008134182 A1 US2008134182 A1 US 2008134182A1
Authority
US
United States
Prior art keywords
resource
enlistment
transaction
transaction manager
manager
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Abandoned
Application number
US12/030,681
Inventor
Alexander J. Somogyi
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Oracle International Corp
Original Assignee
BEA Systems Inc
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by BEA Systems Inc filed Critical BEA Systems Inc
Priority to US12/030,681 priority Critical patent/US20080134182A1/en
Publication of US20080134182A1 publication Critical patent/US20080134182A1/en
Assigned to ORACLE INTERNATIONAL CORPORATION reassignment ORACLE INTERNATIONAL CORPORATION ASSIGNMENT OF ASSIGNORS INTEREST (SEE DOCUMENT FOR DETAILS). Assignors: BEA SYSTEMS, INC.
Abandoned legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F17/00Digital computing or data processing equipment or methods, specially adapted for specific functions

Definitions

  • the current invention relates generally to global transaction management in application servers, and more particularly to global transaction management between multiple applications in application server systems.
  • Transaction managers in enterprise systems may be used to monitor and manage transactions between resources and applications in application server systems.
  • the transaction manager monitors global transactions and provides servers and resources within an application server system with status and availability information regarding other servers and resources.
  • the transaction manager may be provided by the application sever provided.
  • One such provider of application servers is BEA Systems, Inc. of San Jose, Calif., who provide the Web Logic Server application server system.
  • the WebLogic Server (WLS) Transaction Manager (TM) implements the J2EETM JTA specification. This specification is based on the OpenGroup Distributed Transaction Processing Model (DTPM).
  • DTPM OpenGroup Distributed Transaction Processing Model
  • FIG. 1 A typical J2EETM distributed transaction processing model 100 is depicted in FIG. 1 .
  • Distributed Transaction Processing Model 100 includes application (App) 110 , resource manager (RM) 120 , and transaction manager (TM) 130 .
  • the TM coordinates two-phase commit (2PC) transactions that involve multiple resources. Resources developed by third parties may be utilized in WLS applications because they adhere to the J2EETM standards.
  • the App communicates with the RM using an API such as JDBCTM (for relational databases) and JMS (for queuing systems).
  • the App controls transaction demarcation using the JTA API.
  • the TM communicates with the RM during 2PC processing using the X/Open XA interface, specifically the XAResource interface as defined in the J2EETM JTA specification.
  • This interface provides methods for enlisting and delisting a resource in a global transaction, preparing the resource (first phase of 2PC), and committing or rolling back the resource (second phase of 2PC).
  • failure recovery recovery
  • isSameRM resource comparison
  • error processing forget
  • Application components access an RM using the various APIs. These APIs typically utilize a logical connection to the resource.
  • a logical resource connection is often associated with a XAResource instance.
  • Enlistment of a resource in a global transaction entails having the TM associate the unique transaction identifier (Xid) with work that is performed in the resource, and is performed by invoking the XAResource.start( ) method on the resource. Subsequent application updates to the resource will be associated with the global transaction.
  • Resource delistment entails having the TM invoke XAResource.end on the resource, which disassociates future application updates on the resource over the logical connection from the previously enlisted Xid.
  • FIG. 2 illustrates a typical resource enlistment process 200 .
  • the App 110 first begins a global transaction at step 210 .
  • the App then accesses the resource and invokes an update operation on the resource at step 220 using an API specific to the resource. For instance, the App may perform a JDBCTM update operation.
  • the resource first makes a call into the TM at step 230 using the Transaction.enlistResource method.
  • the resource passes the TM the XAResource object that the TM needs to utilize in order to perform the transaction enlistment and 2PC processing when the transaction is later committed or rolled back.
  • the TM In response to the enlistResource call, the TM will invoke XAResource.start on the resource at step 240 .
  • the application update is then performed in the resource at step 250 and is associated with the transaction that was specified during the enlistment start method.
  • the resource may invoke the delistResource method on the TM at step 260 to disassociate future operations from the transaction.
  • the TM responds by calling XAResource.end on the resource at step 270 .
  • the process 200 of resource enlistment is then complete.
  • a second application may attempt to establish a logical connection with the same resource or attempt a concurrent update to the resource.
  • the second connection attempt would fail and result in an exception because to have different transactions simultaneously enlisted with a single logical connection is an XA protocol violation.
  • What is needed is a transaction manager that can manage multiple transaction requests from a resource object, thereby improving the efficiency of global transaction processing.
  • a transaction manager maintains an enlistment data structure used for managing resource object enlistment in global transactions.
  • a transaction manager receives an enlistment request initiated from a resource object.
  • the transaction manager determines if the resource object is already enlisted within the data structure. If the resource object is enlisted, the transaction manager will block the enlistment request. If the resource object is not enlisted, the transaction manger will enlist the resource.
  • the resource object Upon enlistment, the resource object will perform a requested task or service and the resource is considered locked. After the requested task or service is complete, the resource initiates a delistment request to the transaction manager. After receiving the delistment request from the resource object, the transaction manager is delisted from the enlistment data structure.
  • FIG. 1 is an illustration of a J2EETM Distributed Transaction Processing Model in accordance with the prior art.
  • FIG. 2 is an illustration of a method for implementing resource enlistment in accordance with the prior art.
  • FIG. 3 is an illustration of a method for implementing interleaving resource enlistment in accordance with one embodiment of the present invention.
  • FIG. 4 is an illustration of interleaving resource enlistment synchronization in accordance with one embodiment of the present invention.
  • a transaction manager maintains an enlistment data structure used for managing resource object enlistment.
  • a transaction manager may receive an enlistment request initiated from a resource object. Upon receiving the request, the transaction manager will determine if the resource object is already enlisted. If the resource object is already enlisted, the transaction manager will block the enlistment request. If the resource object is not enlisted, the transaction manger will enlist the resource. Upon enlistment, the resource object will perform a requested task or service and the resource is considered locked. After the requested task or service is complete, the resource initiates a delistment request to the transaction manager. After receiving the delistment request from the resource object, the transaction manager is delisted from the enlistment data structure.
  • FIG. 3 illustrates a system 300 for implementing interleaving resource enlistment in accordance with one embodiment of the present invention.
  • System 300 includes thread T 1 320 , App 321 , TM 322 , thread T 2 330 , App 331 , resource connection object 340 , and XAResource 341 .
  • system 300 may be implemented on an application server system.
  • the application server system may be on a single machine or several machines.
  • Apps 321 and 331 may request a service from a resource during a connection involving different types of APIs.
  • the system and methods of the present invention may be implemented using the different types of APIs and their related connection formats, including connections for JDBCTM and sessions for JMS.
  • Elements 301 through 312 represent communications that comprise the interleaving enlistment process.
  • App 321 makes a call to update a resource at 301 .
  • the call is received by resource connection object 340 .
  • the request may include a call to a method in the resource object, and may include the passing of parameters to the resource object.
  • the resource connection object 340 places a call to the TM at 302 .
  • the call from the resource to the transaction manager may be over an XA protocol interface.
  • the call may include resource object information and may be to a method that enlists resources, such as enlistResource, thus informing the transaction manager that current work performed by the resource is to be associated with the current transaction.
  • the transaction manager enlists the resource in the transaction.
  • the TM will then signal at 304 to the resource to begin processing the call to the resource.
  • an App 331 may make a call 303 to the resource connection object 340 .
  • an App may make a call to the resource connection object 340 at some point before or after the call 303 by App 331 as illustrated in FIG. 3 .
  • the TM of the interleaving enlistment system 300 will handle the call by the subsequent App call in serial as long as App 321 is already enlisted.
  • the resource connection object places another call to the TM at 302 .
  • the enlistment request by thread T 2 330 is blocked until the in-progress enlistment of thread T 1 completes.
  • the blocked enlistment of thread T 2 prevents different transactions enlisted with a logical connection to the same resource at the same time.
  • the resource 341 performs the task requested by App 321 in thread T 1 320 .
  • the task involves performing operations of a resource object method called by the application.
  • the resource object initiates delistment.
  • the resource object calls a delist resource method in the transaction manager at 306 . Calling the delist resource method on the TM delists the resource from the current transaction.
  • the call to delist the resource includes the transaction ID (XID) as a parameter.
  • the TM makes a call 307 to the resource to end the logical connection associated with the current transaction.
  • the TM calls a XA resource end method on the resource object and provides the XID as a parameter.
  • the resource object may perform a self update such that resource object actions are no longer associated with the XID.
  • the resource may provide a result to the application at 309 that requested the resource services.
  • the result may be provided before, after, or during the resource delistment depending upon the particular resource design and implementation of the transaction manager, resource object, and client application.
  • the TM places a call 307 to the XAResource ending the resource's association with the current transaction, the TM makes another call to the XAResource at 308 to initiate the resource to perform work associated with the second thread 330 and corresponding transaction ID.
  • the XAResource then performs work associated with the second thread 330 , and delists the resource with the transaction ID in a call 310 to the TM.
  • the TM responds to the delist call 310 by calling the XAResource to indicate that the resource should stop associating work performed with the transaction ID provided at step 308 .
  • the XAResource may then provide results at 312 to the application 331 as discussed above with respect to App 321 in step 309 .
  • the synchronization system 400 includes thread T 1 420 , TM 422 , thread T 2 430 , activeXAResource 440 , and XAResource 442 .
  • each XAResource instance in a server node (only one illustrated in FIG. 4 ) is wrapped in an object that the TM will use to synchronize concurrent enlistment requests.
  • the TM maintains a collection of these wrapper objects which are checked for each resource enlistment.
  • the TM will first check to see if there is a lock being held on the resource by another thread of control.
  • the lock is granted to the accessor and held until the owner Xid delists the resource.
  • the waiting threads if any, will be signaled once the lock is free. Once free, one of the waiting threads will be granted the lock and will be allowed to proceed with its enlistment. In one embodiment, the waiting thread that requested the resource first will be granted the lock. In another embodiment, some other priority method may be used to determine which thread will be granted the lock, such as threads handling a specific type of application.
  • the collection of wrapped XAResource objects may be periodically processed to remove objects that are no unused or no longer active. In one embodiment, the wrapped XAResource objects are periodically garbage collected to clear state and unused entries.
  • the synchronization process of system 400 is illustrated by steps 401 through 408 .
  • the TM 422 of the first thread 420 enlists the XAResource 440 .
  • the enlistment request is received by ActiveXAResource wrapper 440 .
  • thread 420 obtains a lock on the XAResource.
  • the ActiveXAResource wrapper than initiates the start of work by the XAResource 442 at step 403 .
  • the TM delists the XAResource.
  • the delist call 404 is received by ActiveXAResource wrapper 440 .
  • the wrapper 440 than sends an end call to XAResource 405 , thus ending work performed by the XAResource from being associated with thread 420 and releasing the lock on the XAResource.
  • the synchronization of the second thread 430 tasks with the tasks of first thread 420 is illustrated in FIG. 4 .
  • the TM 422 enlists the XAResource and obtains the lock to the resource at step 401 .
  • any attempted enlist from the second thread 430 is blocked.
  • the enlist attempt at step 402 from thread 430 is blocked as it occurs later in time than the enlist step 401 of thread 420 .
  • the lock may be implemented using JavaTM monitor or some similar method. The lock is held until the thread has completed performing operations on the resource.
  • the second thread 430 may obtain the lock at step 406 .
  • the XAResource may begin performing work for the second thread.
  • the resource is delisted from the transaction ID at step 407
  • the XAResource work for the second thread ends at step 408 and the lock on the XAResource is released.
  • the transaction manager may maintain an enlistment data structure (EDS) to help manage resource enlistments.
  • EDS enlistment data structure
  • the EDS maintains a mapping of resources and transaction identification information currently in use, including XA resource objects.
  • the transaction manager searches the EDS to determine if the resource is already listed. If the resource is not listed in the EDS, the transaction manager lists the resource in the EDS.
  • a thread associated with an application may call a method on a resource already enlisted in the EDS. In this case, the transaction manager will block the enlistment of the resource. The resource then waits until the enlistment of the resource win the EDS is removed.
  • the transaction manager contains identification information regarding the resource within the EDS at least until the transaction manager receives a signal indicating the resource has generated a result or otherwise completed the service invoked by the initiating application.
  • enlistments of resources are removed at predetermined time intervals. At each time interval, each enlistment is checked to determine if it has not been accessed for at certain period of time. If an enlistment has not been accessed for the certain period of time, it is delisted from the EDS automatically. In another embodiment, the delistment occurs as soon as the resource has been idle (not accessed) for the certain period of time. In this case, the transaction manager does not wait for the time interval to expire before determining if any resource objects have not been accessed.
  • the idle period and time check interval may be chosen based on the design and operation of the specific application server system as will be understood by those skilled in the art of application server programming.
  • a transaction manager maintains an enlistment data structure used for managing resource object enlistment.
  • a transaction manager may receive an enlistment request initiated from a resource object. Upon receiving the request, the transaction manager will determine if the resource object is already enlisted. If the resource object is already enlisted, the transaction manager will block the enlistment request. If the resource object is not enlisted, the transaction manger will enlist the resource. Upon enlistment, the resource object will perform a requested task or service and the resource is considered locked. After the requested task or service is complete, the resource initiates a delistment request to the transaction manager. After receiving the delistment request from the resource object, the transaction manager is delisted from the enlistment data structure.
  • the present invention may be conveniently implemented using a conventional general purpose or a specialized digital computer or microprocessor programmed according to the teachings of the present disclosure, as will be apparent to those skilled in the computer art.
  • the present invention includes a computer program product which is a storage medium (media) having instructions stored thereon/in which can be used to program a computer to perform any of the processes of the present invention.
  • the storage medium can include, but is not limited to, any type of disk including floppy disks, optical discs, DVD, CD-ROMs, microdrive, and magneto-optical disks, ROMs, RAMs, EPROMs, EEPROMs, DRAMs, VRAMs, flash memory devices, magnetic or optical cards, nanosystems (including molecular memory ICs), or any type of media or device suitable for storing instructions and/or data.
  • the present invention includes software for controlling both the hardware of the general purpose/specialized computer or microprocessor, and for enabling the computer or microprocessor to interact with a human user or other mechanism utilizing the results of the present invention.
  • software may include, but is not limited to, device drivers, operating systems, and user applications.

Abstract

A transaction manager maintains an enlistment data structure used for managing resource object enlistment. A transaction manager may receive an enlistment request initiated from a resource object. Upon receiving the request, the transaction manager will determine if the resource object is already enlisted. If the resource object is already enlisted, the transaction manager will block the enlistment request. If the resource object is not enlisted, the transaction manger will enlist the resource. Upon enlistment, the resource object will perform a requested task or service. After the requested task or service is complete, the resource initiates a delistment request to the transaction manager. After receiving the delistment request from the resource, object, the transaction manager is delisted from the enlistment data structure.

Description

    CLAIM OF PRIORITY
  • The present application is a continuation of pending U.S. patent application Ser. No. 10/789,010 entitled “METHOD FOR PROTECTION AGAINST INTERLEAVING TRANSACTIONS USING A TRANSACTION MANAGER” by Alexander J. Somogyi, filed Feb. 27, 2004, which claims the benefit of priority under 35 U.S.C. §119(e) to U.S. Provisional Patent Application No. 60/451,354, filed on Feb. 28, 2003, which applications are incorporated herein by reference.
  • COPYRIGHT NOTICE
  • A portion of the disclosure of this patent document contains material which is subject to copyright protection. The copyright owner has no objection to the facsimile reproduction by anyone of the patent document or the patent disclosure, as it appears in the Patent and Trademark Office patent file or records, but otherwise reserves all copyright rights whatsoever.
  • CROSS REFERENCE TO RELATED APPLICATION
  • The present application is related to the following U.S. patent application, which application is assigned to the owner of the present invention, and which application is incorporated by reference herein in its entirety:
  • U.S. patent application Ser. No. 10/788,802, entitled “PROTECTION AGAINST INTERLEAVING TRANSACTIONS USING A TRANSACTION MANAGER,” filed on Feb. 27, 2004, currently pending.
  • FIELD OF THE INVENTION
  • The current invention relates generally to global transaction management in application servers, and more particularly to global transaction management between multiple applications in application server systems.
  • BACKGROUND OF THE INVENTION
  • Transaction managers in enterprise systems may be used to monitor and manage transactions between resources and applications in application server systems. In particular, the transaction manager monitors global transactions and provides servers and resources within an application server system with status and availability information regarding other servers and resources.
  • The transaction manager may be provided by the application sever provided. One such provider of application servers is BEA Systems, Inc. of San Jose, Calif., who provide the Web Logic Server application server system. The WebLogic Server (WLS) Transaction Manager (TM) implements the J2EE™ JTA specification. This specification is based on the OpenGroup Distributed Transaction Processing Model (DTPM). A typical J2EE™ distributed transaction processing model 100 is depicted in FIG. 1. Distributed Transaction Processing Model 100 includes application (App) 110, resource manager (RM) 120, and transaction manager (TM) 130. The TM coordinates two-phase commit (2PC) transactions that involve multiple resources. Resources developed by third parties may be utilized in WLS applications because they adhere to the J2EE™ standards. The App communicates with the RM using an API such as JDBC™ (for relational databases) and JMS (for queuing systems). The App controls transaction demarcation using the JTA API. The TM communicates with the RM during 2PC processing using the X/Open XA interface, specifically the XAResource interface as defined in the J2EE™ JTA specification. This interface provides methods for enlisting and delisting a resource in a global transaction, preparing the resource (first phase of 2PC), and committing or rolling back the resource (second phase of 2PC). There are also methods for use in failure recovery (recover), resource comparison (isSameRM) and error processing (forget).
  • Application components access an RM using the various APIs. These APIs typically utilize a logical connection to the resource. A logical resource connection is often associated with a XAResource instance. Enlistment of a resource in a global transaction entails having the TM associate the unique transaction identifier (Xid) with work that is performed in the resource, and is performed by invoking the XAResource.start( ) method on the resource. Subsequent application updates to the resource will be associated with the global transaction. Resource delistment entails having the TM invoke XAResource.end on the resource, which disassociates future application updates on the resource over the logical connection from the previously enlisted Xid.
  • FIG. 2 illustrates a typical resource enlistment process 200. In process 200, the App 110 first begins a global transaction at step 210. The App then accesses the resource and invokes an update operation on the resource at step 220 using an API specific to the resource. For instance, the App may perform a JDBC™ update operation. When the update operation is invoked on the resource, the resource first makes a call into the TM at step 230 using the Transaction.enlistResource method. The resource passes the TM the XAResource object that the TM needs to utilize in order to perform the transaction enlistment and 2PC processing when the transaction is later committed or rolled back. In response to the enlistResource call, the TM will invoke XAResource.start on the resource at step 240. The application update is then performed in the resource at step 250 and is associated with the transaction that was specified during the enlistment start method. After the application request has been processed, the resource may invoke the delistResource method on the TM at step 260 to disassociate future operations from the transaction. The TM responds by calling XAResource.end on the resource at step 270. The process 200 of resource enlistment is then complete.
  • While a first application has a logical connection with a resource, a second application may attempt to establish a logical connection with the same resource or attempt a concurrent update to the resource. In such a case, the second connection attempt would fail and result in an exception because to have different transactions simultaneously enlisted with a single logical connection is an XA protocol violation.
  • What is needed is a transaction manager that can manage multiple transaction requests from a resource object, thereby improving the efficiency of global transaction processing.
  • SUMMARY OF THE INVENTION
  • In one embodiment of the present invention, a method is provided in which a transaction manager maintains an enlistment data structure used for managing resource object enlistment in global transactions. A transaction manager receives an enlistment request initiated from a resource object. Upon receiving the request, the transaction manager determines if the resource object is already enlisted within the data structure. If the resource object is enlisted, the transaction manager will block the enlistment request. If the resource object is not enlisted, the transaction manger will enlist the resource. Upon enlistment, the resource object will perform a requested task or service and the resource is considered locked. After the requested task or service is complete, the resource initiates a delistment request to the transaction manager. After receiving the delistment request from the resource object, the transaction manager is delisted from the enlistment data structure.
  • BRIEF DESCRIPTION OF THE DRAWINGS
  • FIG. 1 is an illustration of a J2EE™ Distributed Transaction Processing Model in accordance with the prior art.
  • FIG. 2 is an illustration of a method for implementing resource enlistment in accordance with the prior art.
  • FIG. 3 is an illustration of a method for implementing interleaving resource enlistment in accordance with one embodiment of the present invention.
  • FIG. 4 is an illustration of interleaving resource enlistment synchronization in accordance with one embodiment of the present invention.
  • DETAILED DESCRIPTION
  • In one embodiment of the present invention, a transaction manager maintains an enlistment data structure used for managing resource object enlistment. A transaction manager may receive an enlistment request initiated from a resource object. Upon receiving the request, the transaction manager will determine if the resource object is already enlisted. If the resource object is already enlisted, the transaction manager will block the enlistment request. If the resource object is not enlisted, the transaction manger will enlist the resource. Upon enlistment, the resource object will perform a requested task or service and the resource is considered locked. After the requested task or service is complete, the resource initiates a delistment request to the transaction manager. After receiving the delistment request from the resource object, the transaction manager is delisted from the enlistment data structure.
  • FIG. 3 illustrates a system 300 for implementing interleaving resource enlistment in accordance with one embodiment of the present invention. System 300 includes thread T1 320, App 321, TM 322, thread T2 330, App 331, resource connection object 340, and XAResource 341. In one embodiment, system 300 may be implemented on an application server system. The application server system may be on a single machine or several machines. Apps 321 and 331 may request a service from a resource during a connection involving different types of APIs. The system and methods of the present invention may be implemented using the different types of APIs and their related connection formats, including connections for JDBC™ and sessions for JMS.
  • Elements 301 through 312 represent communications that comprise the interleaving enlistment process. First in the process, App 321 makes a call to update a resource at 301. The call is received by resource connection object 340. The request may include a call to a method in the resource object, and may include the passing of parameters to the resource object. Next, the resource connection object 340 places a call to the TM at 302. In one embodiment, the call from the resource to the transaction manager may be over an XA protocol interface. The call may include resource object information and may be to a method that enlists resources, such as enlistResource, thus informing the transaction manager that current work performed by the resource is to be associated with the current transaction. After receiving the call, the transaction manager enlists the resource in the transaction. Next, the TM will then signal at 304 to the resource to begin processing the call to the resource.
  • At some point in the operation of system 300, an App 331 may make a call 303 to the resource connection object 340. In another embodiment, an App may make a call to the resource connection object 340 at some point before or after the call 303 by App 331 as illustrated in FIG. 3. The TM of the interleaving enlistment system 300 will handle the call by the subsequent App call in serial as long as App 321 is already enlisted.
  • At 305, the resource connection object places another call to the TM at 302. The enlistment request by thread T2 330 is blocked until the in-progress enlistment of thread T1 completes. The blocked enlistment of thread T2 prevents different transactions enlisted with a logical connection to the same resource at the same time.
  • Once the resource receives a start signal from the TM at 304, the resource 341 performs the task requested by App 321 in thread T1 320. In one embodiment, the task involves performing operations of a resource object method called by the application. After a result is obtained for the requested task, the resource object initiates delistment. In one embodiment, the resource object calls a delist resource method in the transaction manager at 306. Calling the delist resource method on the TM delists the resource from the current transaction. In one embodiment, the call to delist the resource includes the transaction ID (XID) as a parameter. In response to the delist resource method call to the TM, the TM makes a call 307 to the resource to end the logical connection associated with the current transaction. In one embodiment, the TM calls a XA resource end method on the resource object and provides the XID as a parameter. After receiving an end call 307 from the TM, the resource object may perform a self update such that resource object actions are no longer associated with the XID. Additionally, the resource may provide a result to the application at 309 that requested the resource services. In another embodiment, the result may be provided before, after, or during the resource delistment depending upon the particular resource design and implementation of the transaction manager, resource object, and client application.
  • After the TM places a call 307 to the XAResource ending the resource's association with the current transaction, the TM makes another call to the XAResource at 308 to initiate the resource to perform work associated with the second thread 330 and corresponding transaction ID. The XAResource then performs work associated with the second thread 330, and delists the resource with the transaction ID in a call 310 to the TM. The TM responds to the delist call 310 by calling the XAResource to indicate that the resource should stop associating work performed with the transaction ID provided at step 308. The XAResource may then provide results at 312 to the application 331 as discussed above with respect to App 321 in step 309.
  • An illustration of the interleaving resource enlistment synchronization system 400 is illustrated in FIG. 4. The synchronization system 400 includes thread T1 420, TM 422, thread T2 430, activeXAResource 440, and XAResource 442. In one embodiment, each XAResource instance in a server node (only one illustrated in FIG. 4) is wrapped in an object that the TM will use to synchronize concurrent enlistment requests. The TM maintains a collection of these wrapper objects which are checked for each resource enlistment. In one embodiment, for each request to enlist the resource, the TM will first check to see if there is a lock being held on the resource by another thread of control. If not, the lock is granted to the accessor and held until the owner Xid delists the resource. The waiting threads, if any, will be signaled once the lock is free. Once free, one of the waiting threads will be granted the lock and will be allowed to proceed with its enlistment. In one embodiment, the waiting thread that requested the resource first will be granted the lock. In another embodiment, some other priority method may be used to determine which thread will be granted the lock, such as threads handling a specific type of application. The collection of wrapped XAResource objects may be periodically processed to remove objects that are no unused or no longer active. In one embodiment, the wrapped XAResource objects are periodically garbage collected to clear state and unused entries.
  • The synchronization process of system 400 is illustrated by steps 401 through 408. In step 401, the TM 422 of the first thread 420 enlists the XAResource 440. The enlistment request is received by ActiveXAResource wrapper 440. By enlisting the XAResource via the wrapper, thread 420 obtains a lock on the XAResource. The ActiveXAResource wrapper than initiates the start of work by the XAResource 442 at step 403. Once the XAResource has completed the work performed for thread 420, the TM delists the XAResource. The delist call 404 is received by ActiveXAResource wrapper 440. The wrapper 440 than sends an end call to XAResource 405, thus ending work performed by the XAResource from being associated with thread 420 and releasing the lock on the XAResource.
  • The synchronization of the second thread 430 tasks with the tasks of first thread 420 is illustrated in FIG. 4. Once the TM 422 enlists the XAResource and obtains the lock to the resource at step 401, any attempted enlist from the second thread 430 is blocked. Thus, the enlist attempt at step 402 from thread 430 is blocked as it occurs later in time than the enlist step 401 of thread 420. In one embodiment, the lock may be implemented using Java™ monitor or some similar method. The lock is held until the thread has completed performing operations on the resource. After the lock on XAResource 442 is released at step 405, the second thread 430 may obtain the lock at step 406. At this point, the XAResource may begin performing work for the second thread. After the resource is delisted from the transaction ID at step 407, the XAResource work for the second thread ends at step 408 and the lock on the XAResource is released.
  • In one embodiment, the transaction manager may maintain an enlistment data structure (EDS) to help manage resource enlistments. The EDS maintains a mapping of resources and transaction identification information currently in use, including XA resource objects. When a resource calls the transaction manager to be enlisted, the transaction manager searches the EDS to determine if the resource is already listed. If the resource is not listed in the EDS, the transaction manager lists the resource in the EDS. In some cases, a thread associated with an application may call a method on a resource already enlisted in the EDS. In this case, the transaction manager will block the enlistment of the resource. The resource then waits until the enlistment of the resource win the EDS is removed.
  • The transaction manager contains identification information regarding the resource within the EDS at least until the transaction manager receives a signal indicating the resource has generated a result or otherwise completed the service invoked by the initiating application. In one embodiment, enlistments of resources are removed at predetermined time intervals. At each time interval, each enlistment is checked to determine if it has not been accessed for at certain period of time. If an enlistment has not been accessed for the certain period of time, it is delisted from the EDS automatically. In another embodiment, the delistment occurs as soon as the resource has been idle (not accessed) for the certain period of time. In this case, the transaction manager does not wait for the time interval to expire before determining if any resource objects have not been accessed. These methods of delistment reduce the number of add an remove operations associated with the EDS and make the transaction monitor more efficient. The idle period and time check interval may be chosen based on the design and operation of the specific application server system as will be understood by those skilled in the art of application server programming.
  • In one embodiment of the present invention, a transaction manager maintains an enlistment data structure used for managing resource object enlistment. A transaction manager may receive an enlistment request initiated from a resource object. Upon receiving the request, the transaction manager will determine if the resource object is already enlisted. If the resource object is already enlisted, the transaction manager will block the enlistment request. If the resource object is not enlisted, the transaction manger will enlist the resource. Upon enlistment, the resource object will perform a requested task or service and the resource is considered locked. After the requested task or service is complete, the resource initiates a delistment request to the transaction manager. After receiving the delistment request from the resource object, the transaction manager is delisted from the enlistment data structure.
  • Other features, aspects and objects of the invention can be obtained from a review of the figures and the claims. It is to be understood that other embodiments of the invention can be developed and fall within the spirit and scope of the invention and claims.
  • The foregoing description of preferred embodiments of the present invention has been provided for the purposes of illustration and description. It is not intended to be exhaustive or to limit the invention to the precise forms disclosed. Obviously, many modifications and variations will be apparent to the practitioner skilled in the art. The embodiments were chosen and described in order to best explain the principles of the invention and its practical application, thereby enabling others skilled in the art to understand the invention for various embodiments and with various modifications that are suited to the particular use contemplated. It is intended that the scope of the invention be defined by the following claims and their equivalence.
  • In addition to an embodiment consisting of specifically designed integrated circuits or other electronics, the present invention may be conveniently implemented using a conventional general purpose or a specialized digital computer or microprocessor programmed according to the teachings of the present disclosure, as will be apparent to those skilled in the computer art.
  • Appropriate software coding can readily be prepared by skilled programmers based on the teachings of the present disclosure, as will be apparent to those skilled in the software art. The invention may also be implemented by the preparation of application specific integrated circuits or by interconnecting an appropriate network of conventional component circuits, as will be readily apparent to those skilled in the art.
  • The present invention includes a computer program product which is a storage medium (media) having instructions stored thereon/in which can be used to program a computer to perform any of the processes of the present invention. The storage medium can include, but is not limited to, any type of disk including floppy disks, optical discs, DVD, CD-ROMs, microdrive, and magneto-optical disks, ROMs, RAMs, EPROMs, EEPROMs, DRAMs, VRAMs, flash memory devices, magnetic or optical cards, nanosystems (including molecular memory ICs), or any type of media or device suitable for storing instructions and/or data.
  • Stored on any one of the computer readable medium (media), the present invention includes software for controlling both the hardware of the general purpose/specialized computer or microprocessor, and for enabling the computer or microprocessor to interact with a human user or other mechanism utilizing the results of the present invention. Such software may include, but is not limited to, device drivers, operating systems, and user applications.
  • Included in the programming (software) of the general/specialized computer or microprocessor are software modules for implementing the teachings of the present invention, including, but not limited to, maintaining an enlistment data structure, managing thread execution calls, and implementing a transaction manager that protects against interleaving transactions.

Claims (20)

1. A method for protection against interleaving transactions, comprising:
communicating with a resource manager from an application, wherein multiple threads of the application utilize a shared logical connection to the resource manager;
communicating with the resource manager from a first thread of a transaction manager during two phase commit processing, wherein the first thread of the transaction manager associates a unique transaction identifier with work that is performed on the resource and subsequent application updates to the resource are associated with the unique transaction identifier;
enlisting a resource, wherein the resource is wrapped in an object that the transaction manager uses to synchronize concurrent enlistment requests; and
delisting a resource, wherein future application updates on the resource over the shared logical connection are disassociated from the unique transaction identifier;
wherein a second thread of the transaction manager is blocked from enlisting the resource until the first thread of the transaction manager has delisted the resource.
2. The method of claim 1, wherein the application communicates to the resource manager using a database connection or messaging service.
3. The method of claim 1, wherein each request to enlist the resource will first check to see if there is a lock being held on the resource by another thread of control.
4. The method of claim 3, wherein if a resource is not yet locked, a lock is granted to an accessor and held until the owner of the transaction ID delists the resource.
5. The method of claim 4, wherein waiting threads are signaled when a lock is freed and one of the waiting threads will be granted the lock and allowed to proceed with its enlistment.
6. The method of claim 1, wherein the transaction manager maintains a collection of wrapped objects which is consulted on each resource enlistment.
7. The method of claim 6, wherein the transaction manager maintains an enlistment data structure to manage the collection of wrapped objects.
8. The method of claim 7, wherein the transaction manager contains identification information regarding the resource within the enlistment data structure at least until the transaction manager receives a signal indicating the resource has generated a result or completed a service invoked by the application.
9. The method of claim 8, wherein at a predetermined time interval, each enlistment of a resource that has not been accessed for a certain period of time is delisted from the enlistment data structure.
10. The method of claim 8, wherein a resource is delisted from the enlistment data structure when it has not been accessed for a certain period of time.
11. A computer-readable storage medium, storing instructions for protection against interleaving transactions, the instructions comprising:
communicating with a resource manager from an application, wherein multiple threads of the application utilize a shared logical connection to the resource manager;
communicating with the resource manager from a first thread of a transaction manager during two phase commit processing, wherein the first thread of the transaction manager associates a unique transaction identifier with work that is performed on the resource and subsequent application updates to the resource are associated with the unique transaction identifier;
enlisting a resource, wherein the resource is wrapped in an object that the transaction manager uses to synchronize concurrent enlistment requests; and
delisting a resource, wherein future application updates on the resource over the shared logical connection are disassociated from the unique transaction identifier;
wherein a second thread of the transaction manager is blocked from enlisting the resource until the first thread of the transaction manager has delisted the resource.
12. The computer-readable storage medium of claim 11, wherein the application communicates to the resource manager using a database connection or messaging service.
13. The computer-readable storage medium of claim 11, wherein each request to enlist the resource will first check to see if there is a lock being held on the resource by another thread of control.
14. The computer-readable storage medium of claim 13, wherein if a resource is not yet locked, a lock is granted to an accessor and held until the owner of the transaction ID delists the resource.
15. The computer-readable storage medium of claim 14, wherein waiting threads are signaled when a lock is freed and one of the waiting threads will be granted the lock and allowed to proceed with its enlistment.
16. The computer-readable storage medium of claim 11, wherein the transaction manager maintains a collection of wrapped objects which is consulted on each resource enlistment.
17. The computer-readable storage medium of claim 16, wherein the transaction manager maintains an enlistment data structure to manage the collection of wrapped objects.
18. The computer-readable storage medium of claim 17, wherein the transaction manager contains identification information regarding the resource within the enlistment data structure at least until the transaction manager receives a signal indicating the resource has generated a result or completed a service invoked by the application.
19. The computer-readable storage medium of claim 18, wherein at a predetermined time interval, each enlistment of a resource that has not been accessed for a certain period of time is delisted from the enlistment data structure.
20. The computer-readable storage medium of claim 18, wherein a resource is delisted from the enlistment data structure when it has not been accessed for a certain period of time.
US12/030,681 2003-02-28 2008-02-13 Computer readable storage medium for protection against interleaving transactions using a transaction manager Abandoned US20080134182A1 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
US12/030,681 US20080134182A1 (en) 2003-02-28 2008-02-13 Computer readable storage medium for protection against interleaving transactions using a transaction manager

Applications Claiming Priority (3)

Application Number Priority Date Filing Date Title
US45135403P 2003-02-28 2003-02-28
US10/789,010 US7353495B2 (en) 2003-02-28 2004-02-27 Method for protection against interleaving transactions using a transaction manager
US12/030,681 US20080134182A1 (en) 2003-02-28 2008-02-13 Computer readable storage medium for protection against interleaving transactions using a transaction manager

Related Parent Applications (1)

Application Number Title Priority Date Filing Date
US10/789,010 Continuation US7353495B2 (en) 2003-02-28 2004-02-27 Method for protection against interleaving transactions using a transaction manager

Publications (1)

Publication Number Publication Date
US20080134182A1 true US20080134182A1 (en) 2008-06-05

Family

ID=33162152

Family Applications (2)

Application Number Title Priority Date Filing Date
US10/789,010 Active 2025-11-12 US7353495B2 (en) 2003-02-28 2004-02-27 Method for protection against interleaving transactions using a transaction manager
US12/030,681 Abandoned US20080134182A1 (en) 2003-02-28 2008-02-13 Computer readable storage medium for protection against interleaving transactions using a transaction manager

Family Applications Before (1)

Application Number Title Priority Date Filing Date
US10/789,010 Active 2025-11-12 US7353495B2 (en) 2003-02-28 2004-02-27 Method for protection against interleaving transactions using a transaction manager

Country Status (1)

Country Link
US (2) US7353495B2 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20080183801A1 (en) * 2007-01-29 2008-07-31 Nokia Corporation System, Methods, Apparatuses and Computer Program Products for Providing Step-Ahead Computing

Families Citing this family (22)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20040215594A1 (en) * 2003-01-24 2004-10-28 Bea Systems, Inc. System for transaction processing with parallel execution
US7346905B2 (en) * 2003-06-10 2008-03-18 International Business Machines Corporation Apparatus and method for maintaining resource integrity without a unified transaction manager in a software environment
US8086747B2 (en) * 2003-09-22 2011-12-27 Anilkumar Dominic Group-to-group communication over a single connection
US7484215B2 (en) * 2003-10-30 2009-01-27 International Business Machines Corporation Method, system and program product for processing a transaction
EP2339469A1 (en) 2004-03-13 2011-06-29 Adaptive Computing Enterprises, Inc. System and method for a self-optimizing reservation in time of compute resources
US7890629B2 (en) 2004-03-13 2011-02-15 Adaptive Computing Enterprises, Inc. System and method of providing reservation masks within a compute environment
EP1735706A4 (en) 2004-03-13 2008-08-13 Cluster Resources Inc System and method of co-allocating a reservation spanning different compute resources types
US8782654B2 (en) 2004-03-13 2014-07-15 Adaptive Computing Enterprises, Inc. Co-allocating a reservation spanning different compute resources types
EP1725947A4 (en) * 2004-03-13 2008-08-06 Cluster Resources Inc System and method for providing advanced reservations in a compute environment
US20070266388A1 (en) 2004-06-18 2007-11-15 Cluster Resources, Inc. System and method for providing advanced reservations in a compute environment
US8176490B1 (en) 2004-08-20 2012-05-08 Adaptive Computing Enterprises, Inc. System and method of interfacing a workload manager and scheduler with an identity manager
CA2586763C (en) 2004-11-08 2013-12-17 Cluster Resources, Inc. System and method of providing system jobs within a compute environment
US7996455B2 (en) 2005-06-17 2011-08-09 Adaptive Computing Enterprises, Inc. System and method for providing dynamic roll-back reservations in time
US9075657B2 (en) 2005-04-07 2015-07-07 Adaptive Computing Enterprises, Inc. On-demand access to compute resources
US8863143B2 (en) 2006-03-16 2014-10-14 Adaptive Computing Enterprises, Inc. System and method for managing a hybrid compute environment
US9231886B2 (en) 2005-03-16 2016-01-05 Adaptive Computing Enterprises, Inc. Simple integration of an on-demand compute environment
US8041773B2 (en) 2007-09-24 2011-10-18 The Research Foundation Of State University Of New York Automatic clustering for self-organizing grids
US8356308B2 (en) * 2008-06-02 2013-01-15 Microsoft Corporation Blocking and bounding wrapper for thread-safe data collections
US11720290B2 (en) 2009-10-30 2023-08-08 Iii Holdings 2, Llc Memcached server functionality in a cluster of data processing nodes
US10877695B2 (en) 2009-10-30 2020-12-29 Iii Holdings 2, Llc Memcached server functionality in a cluster of data processing nodes
US9396227B2 (en) * 2012-03-29 2016-07-19 Hewlett Packard Enterprise Development Lp Controlled lock violation for data transactions
US9442971B2 (en) 2013-04-17 2016-09-13 International Business Machines Corporation Weighted transaction priority based dynamically upon phase of transaction completion

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6272675B1 (en) * 1998-10-01 2001-08-07 Unisys Corporation Development system for automatically enabling a server application to execute with an XATMI-compliant transaction manager managing transactions within multiple environments
US20020194244A1 (en) * 2001-06-01 2002-12-19 Joan Raventos System and method for enabling transaction-based service utilizing non-transactional resources
US20050015425A1 (en) * 2003-07-14 2005-01-20 Sun Microsystems, Inc. Transaction manager freezing
US20050120036A1 (en) * 2000-03-30 2005-06-02 Microsoft Corporation Transactional file system
US7076784B1 (en) * 1997-10-28 2006-07-11 Microsoft Corporation Software component execution management using context objects for tracking externally-defined intrinsic properties of executing software components within an execution environment

Family Cites Families (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
GB2327134B (en) * 1997-07-08 2002-04-03 Ibm Apparatus,method and computer program for providing arbitrary locking requesters for controlling concurrent access to server resources
US6157927A (en) * 1998-04-22 2000-12-05 Unisys Corporation Methods and apparatus for enabling a component in a first transaction processing environment to access a resource in another environment that is under the control of an Xatmi complaint transaction manager
US6275863B1 (en) * 1999-01-25 2001-08-14 International Business Machines Corp. System and method for programming and executing long running transactions
US6470342B1 (en) * 1999-03-12 2002-10-22 Compaq Computer Corporation Process of maintaining a distributed map of transaction identifiers and using hashing to access these maps
US20020087366A1 (en) 2000-12-30 2002-07-04 Collier Timothy R. Tentative-hold-based protocol for distributed transaction processing
US20040153349A1 (en) * 2003-01-31 2004-08-05 K. Venugopal Rao Delayed creation of global transactions
US7383336B2 (en) * 2003-04-24 2008-06-03 International Business Machines Corporation Distributed shared resource management

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7076784B1 (en) * 1997-10-28 2006-07-11 Microsoft Corporation Software component execution management using context objects for tracking externally-defined intrinsic properties of executing software components within an execution environment
US6272675B1 (en) * 1998-10-01 2001-08-07 Unisys Corporation Development system for automatically enabling a server application to execute with an XATMI-compliant transaction manager managing transactions within multiple environments
US20050120036A1 (en) * 2000-03-30 2005-06-02 Microsoft Corporation Transactional file system
US20020194244A1 (en) * 2001-06-01 2002-12-19 Joan Raventos System and method for enabling transaction-based service utilizing non-transactional resources
US20050015425A1 (en) * 2003-07-14 2005-01-20 Sun Microsystems, Inc. Transaction manager freezing

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20080183801A1 (en) * 2007-01-29 2008-07-31 Nokia Corporation System, Methods, Apparatuses and Computer Program Products for Providing Step-Ahead Computing
US8819215B2 (en) * 2007-01-29 2014-08-26 Nokia Corporation System, methods, apparatuses and computer program products for providing step-ahead computing
US20140330966A1 (en) * 2007-01-29 2014-11-06 Nokia Corporation System, methods, apparatuses and computer program products for providing step-ahead computing
US9900405B2 (en) * 2007-01-29 2018-02-20 Nokia Technologies Oy System, methods, apparatuses and computer program products for providing step-ahead computing

Also Published As

Publication number Publication date
US7353495B2 (en) 2008-04-01
US20040210590A1 (en) 2004-10-21

Similar Documents

Publication Publication Date Title
US20080134182A1 (en) Computer readable storage medium for protection against interleaving transactions using a transaction manager
US8327375B2 (en) System and method for supporting resource enlistment synchronization
US7117214B2 (en) Systems and methods for maintaining transactional persistence
US8375359B2 (en) Parallel transaction execution with a thread pool
US6728958B1 (en) Volatile resource manager with pre-prepare notification
CN104793988B (en) The implementation method and device of integration across database distributed transaction
US6266698B1 (en) Logging of transaction branch information for implementing presumed nothing and other protocols
US5095421A (en) Transaction processing facility within an operating system environment
US20040158549A1 (en) Method and apparatus for online transaction processing
US20060248283A1 (en) System and method for monitoring threads in a clustered server architecture
US20150172390A1 (en) Idempotence For Database Transactions
US6381617B1 (en) Multiple database client transparency system and method therefor
US20070043784A1 (en) Advanced fine-grained administration of recovering transactions
JPH08272725A (en) System and method for judgment and operation of constituent conformation of server in distributed object environment
JP2010157202A (en) Distributed transaction recovery system and method
US8046731B2 (en) Timer service computer program components
US8132174B2 (en) Concurrency management in cluster computing of business applications
WO1996039659A1 (en) Synchronisation procedure in a routing node
US7702957B2 (en) Systems and methods for timer service
US6807547B2 (en) Method and apparatus for implementing timers for enterprise javabean components
US20040045008A1 (en) J2ee connector architecture
JP2001056767A (en) Method for cleaning up internal state by using transaction service synchronous interface
US9582313B2 (en) Connection resource system
US20030046258A1 (en) Method and system for removal of resource manager affinity during restart in a transaction processing system
US9984096B2 (en) System and method for reducing communications overhead in a distributed transactions environment by modifying implementation of the transaction start function

Legal Events

Date Code Title Description
AS Assignment

Owner name: ORACLE INTERNATIONAL CORPORATION, CALIFORNIA

Free format text: ASSIGNMENT OF ASSIGNORS INTEREST;ASSIGNOR:BEA SYSTEMS, INC.;REEL/FRAME:025192/0244

Effective date: 20101008

STCB Information on status: application discontinuation

Free format text: ABANDONED -- FAILURE TO RESPOND TO AN OFFICE ACTION