The novel features believed characteristic of the invention are set forth in the appended claims. The invention itself, however, as well as a preferred mode of use, further objectives and advantages thereof, will best be understood by reference to the following detailed description of an illustrative embodiment when read in conjunction with the accompanying drawings, wherein:
With reference now to the figures and in particular with reference to
With reference now to the figures,
In the depicted example, server 104 and server 106 connect to network 102 along with storage unit 108. In addition, clients 110, 112, and 114 connect to network 102. These clients 110, 112, and 114 may be, for example, personal computers or network computers. In the depicted example, server 104 provides data, such as boot files, operating system images, and applications to clients 110, 112, and 114. Clients 110, 112, and 114 are clients to server 104 in this example. Network data processing system 100 may include additional servers, clients, and other devices not shown.
In the depicted example, network data processing system 100 is the Internet with network 102 representing a worldwide collection of networks and gateways that use the Transmission Control Protocol/Internet Protocol (TCP/IP) suite of protocols to communicate with one another. At the heart of the Internet is a backbone of high-speed data communication lines between major nodes or host computers, consisting of thousands of commercial, governmental, educational and other computer systems that route data and messages. Of course, network data processing system 100 also may be implemented as a number of different types of networks, such as for example, an intranet, a local area network (LAN), or a wide area network (WAN).
With reference now to
In the depicted example, data processing system 200 employs a hub architecture including a north bridge and memory controller hub (MCH) 202 and a south bridge and input/output (I/O) controller hub (ICH) 204. Processor 206, main memory 208, and graphics processor 210 are coupled to north bridge and memory controller hub 202. Graphics processor 210 may be coupled to the MCH through an accelerated graphics port (AGP), for example.
In the depicted example, local area network (LAN) adapter 212 is coupled to south bridge and I/O controller hub 204 and audio adapter 216, keyboard and mouse adapter 220, modem 222, read only memory (ROM) 224, universal serial bus (USB) ports and other communications ports 232, and PCI/PCIe devices 234 are coupled to south bridge and I/O controller hub 204 through bus 238, and hard disk drive (HDD) 226 and CD-ROM drive 230 are coupled to south bridge and I/O controller hub 204 through bus 240. PCI/PCIe devices may include, for example, Ethernet adapters, add-in cards, and PC cards for notebook computers. PCI uses a card bus controller, while PCIe does not. ROM 224 may be, for example, a flash binary input/output system (BIOS). Hard disk drive 226 and CD-ROM drive 230 may use, for example, an integrated drive electronics (IDE) or serial advanced technology attachment (SATA) interface. A super I/O (SIO) device 236 may be coupled to south bridge and I/O controller hub 204.
An operating system runs on processor 206 and coordinates and provides control of various components within data processing system 200 in
Instructions for the operating system, the object-oriented programming system, and applications or programs are located on storage devices, such as hard disk drive 226, and may be loaded into main memory 208 for execution by processor 206. The processes of the illustrative embodiments may be performed by processor 206 using computer implemented instructions, which may be located in a memory such as, for example, main memory 208, read only memory 224, or in one or more peripheral devices.
The hardware in
In some illustrative examples, data processing system 200 may be a personal digital assistant (PDA), which is generally configured with flash memory to provide non-volatile memory for storing operating system files and/or user-generated data. A bus system may be comprised of one or more buses, such as a system bus, an I/O bus and a PCI bus. Of course the bus system may be implemented using any type of communications fabric or architecture that provides for a transfer of data between different components or devices attached to the fabric or architecture. A communications unit may include one or more devices used to transmit and receive data, such as a modem or a network adapter. A memory may be, for example, main memory 208 or a cache such as found in north bridge and memory controller hub 202. A processing unit may include one or more processors or CPUs. The depicted examples in
Locks are typically employed in database systems to isolate data, such that the data cannot be accessed by another while the data is being modified. For example, if a client wants to modify data in a database, the client issues a lock request to the database system, which isolates the data by granting the lock request to the client. The client may then modify the data and the integrity of the data may be preserved. However, there is presently no generic lock manager service available outside of a database system for other non-database applications to use, such as business integration applications. For example, a client may send a service request to a business integration application, such as a banking service, to update a particular bank account, such as depositing a sum of money into the account.
The illustrative embodiments overcome the limitations in the current art by providing a generic lock manager service that allows for isolating data in business integration environments. With the generic lock manager service in the illustrative embodiments, applications in the business integration environment are allowed to perform lock requests synchronously and asynchronously. In a synchronous lock request, the client initiates the lock request and then suspends its processing while waiting for the lock to be granted. In this manner, the client waits to initiate other lock requests until the previous lock request has been granted. In an asynchronous lock request, the client initiates the lock request and then resumes its processing without waiting for a response. In other words, the requesting client may queue up multiple lock requests if the lock requests cannot be granted at that time. The lock manager service may handle the client lock request and grant the lock at a later time, at which time the client receives the lock and proceeds with its processing.
The generic lock manager service also preserves the locks and lock requests in a persistent storage, such that the locks and lock requests can be recovered across system failures or system restarts. In this manner, the lock manager service provides an extremely useful capability for long-lived business processes, such as long-lived Business Process Execution Language (BPEL) workflows, where the client may be dormant after the lock requests.
Turning now to
SCA infrastructure 304 provides a container in which components, such as lock manager service 302, may reside. Services are provided by the components and made available by the SCA. For example, an SCA client may send lock requests 306 to lock manager service 302 in SCA infrastructure 304, and in response, the lock service may grant the requested lock to the client. By exposing the lock manager service 302 as an SCA service, any SCA client may be allowed to invoke this lock manager service.
In addition, lock manager service preserves locks and lock requests in persistent storage 308. Persistent storage 308 is an example of a storage unit, such as storage unit 108 in
For an asynchronous lock request, LockManager interface 402 includes lockAsync method 412, which comprises parameters Object o 414, Object l 416, int mode 418, and callback 420. Object o 414 specifies the lock requester's ID. Object l 416 specifies the object to be locked. Int mode 418 specifies the lock mode requested (in this case ‘asynchronous’). Callback 420 specifies the client callback interface for the asynchronous lock method to inform the client that the lock request has been granted.
LockManager interface 402 also includes unlockOnly method 422 and unlock method 424. When the requesting client completes the business process and no longer requires access to the data, unlockOnly method 422 is used to unlock the data. UnlockOnly method 422 comprises parameters Object o 414 and Object l 416. UnlockOnly method 422 only removes the lock, but does not perform a callback to the client. This UnlockOnly method 422 is useful in situations where there are security concerns or class loader issues, such as if the lockCallback has to be executed under a different security credential or in a different class loader. In situations where a callback to the client may be performed, unlock method 424 comprising parameters Object o 414 and Object l 416 may be used.
Persistent lock table scheme 600 creates a schema that creates 602 and alters 606 PersistentLock table 604. PersistentLockTable 604 includes Owner 608, Message 610, LockID 612, and SequenceID 614 fields. Owner 608 field specifies the owner of the lock request. Message 610 field maps to the callback in the lockAsync 412 method in
If no persistent lock request is found (a ‘no’ output to step 704) (i.e., the lock request received is the only lock request in the queue for that particular data object), the lock manager service persists the lock request in a persistent storage and assigns the lock request a sequence ID of “1” (step 706). The lock manager service then notifies the requesting client that the lock has been granted by returning a value of “true” (step 708), with the process terminating thereafter.
Turning back to step 704, if the lock manager service determines the queue already contains one or more requests to lock the particular data object (a ‘yes’ output to step 704), the lock manager service obtains the maximum sequence ID number S (step 710). The lock manager service then persists the lock request and assigns the lock request a sequence ID of “S+1” (step 712). The handling of the sequence ID number may be properly protected by either synchronizing the sequence numbers throughout the entire operation or by initiating sequence ID assignment retries in the case of conflicting/duplicating sequence numbers. Once a sequence ID is assigned, the lock manager service then notifies the requesting client that the lock has not been granted by returning a value of “false” (step 714), with the process terminating thereafter. By persisting the lock requests in a persistent storage and using a sequence number, the lock manager service may guarantee that the locks and lock requests will survive system failures and restarts, which can be critical in the business integration market.
If the lock request queue does contains another lock request for the particular data object (a ‘yes’ output to step 808), a determination is then made as to whether the queued lock request is called by an unlockOnly interface call, such as unlockOnly method 422, or an unlock interface call, such as unlock method 424 in
If the queued lock request is called by the unlockOnly interface call (a ‘yes’ output to step 810), the lock manager service returns the callback to the requesting client (step 812), with the process terminating thereafter. Turning back to step 810, if the queued lock request is not called by the unlock interface call (a ‘no’ output to step 810), the lock manager service performs the callback invocation (step 814), with the process terminating thereafter.
The invention can take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment containing both hardware and software elements. In a preferred embodiment, the invention is implemented in software, which includes but is not limited to firmware, resident software, microcode, etc.
Furthermore, the invention can take the form of a computer program product accessible from a computer-usable or computer-readable medium providing program code for use by or in connection with a computer or any instruction execution system. For the purposes of this description, a computer-usable or computer readable medium can be any tangible apparatus that can contain, store, communicate, propagate, or transport the program for use by or in connection with the instruction execution system, apparatus, or device.
The medium can be an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system (or apparatus or device) or a propagation medium. Examples of a computer-readable medium include a semiconductor or solid state memory, magnetic tape, a removable computer diskette, a random access memory (RAM), a read-only memory (ROM), a rigid magnetic disk and an optical disk. Current examples of optical disks include compact disk-read only memory (CD-ROM), compact disk-read/write (CD-R/W) and DVD.
A data processing system suitable for storing and/or executing program code will include at least one processor coupled directly or indirectly to memory elements through a system bus. The memory elements can include local memory employed during actual execution of the program code, bulk storage, and cache memories which provide temporary storage of at least some program code in order to reduce the number of times code must be retrieved from bulk storage during execution.
Input/output or I/O devices (including but not limited to keyboards, displays, pointing devices, etc.) can be coupled to the system either directly or through intervening I/O controllers.
Network adapters may also be coupled to the system to enable the data processing system to become coupled to other data processing systems or remote printers or storage devices through intervening private or public networks. Modems, cable modem and Ethernet cards are just a few of the currently available types of network adapters.
The description of the present invention has been presented for purposes of illustration and description, and is not intended to be exhaustive or limited to the invention in the form disclosed. Many modifications and variations will be apparent to those of ordinary skill in the art. The embodiment was chosen and described in order to best explain the principles of the invention, the practical application, and to enable others of ordinary skill in the art to understand the invention for various embodiments with various modifications as are suited to the particular use contemplated.