Patent ID: 7849464

Claim:
A system for supporting resource enlistment synchronization, comprising: an application server with a plurality of threads, wherein the application server runs on one or more processors and is associated with a plurality of applications, wherein each application is associated with at least one said thread; at least one resource object, wherein the at least one resource object is associated with a resource connection object; a transaction manager that manages a plurality of transactions, wherein each transaction is associated with each application; wherein the resource connection object operates to perform: receiving a request, to access the at least one resource object that is associated with the resource connection object, from an application of the plurality of applications that runs on a thread of the plurality of threads, and placing a call to the transaction manager and informing the transaction manager that current work performed by the at least one resource object is to be associated with a current transaction that is associated with the application, and wherein, after receiving the call from the resource connection object, the transaction manager operates to perform: first checking to see if there is an in-progress enlistment of the at least one resource object by another thread in another transaction, if there is a lock, blocking the request to enlist the resource object in the transaction and preventing different transactions from enlisting a logical connection to the at least one resource object at same time, and initiating the at least one resource object to perform work associated with the thread and the current transaction, after the at least one resource object is delisted from another transaction that owns the lock, if there is no lock, enlisting the at least one resource object in the transaction and signaling the at least one resource object to begin processing the request, receiving from the at least one resource object a delist resource method call, after a result is obtained for the request, to delist the at least one resource object from the current transaction and provides the result to the application, and initiating the at least one resource object to perform work associated with another thread and another transaction.