parallel development and concurrency control in nwdi...concurrency control defines a controlled way...
TRANSCRIPT
SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com
© 2011 SAP AG 1
Parallel Development and
Concurrency Control in NWDI
Applies to:
Application Lifecycle Management, Composition Environment (CE), Enterprise Portal (EP), Product Lifecycle Management, SAP NetWeaver Platform. For more information, visit the Repository-based Modeling and Design homepage.
Summary
This article explains about the efficient capabilities of SAP Netweaver Development Infrastructure (NWDI) and how it leverages parallel developments and facilitates concurrency control.
Author: Shreyas Pandya
Company: Enteg Infotech Pvt. Ltd.
Created on: 11 February 2011
Author Bio
Shreyas Pandya is a SAP Netweaver Enterprise Portal Consultant at Enteg Infotech Pvt. Ltd, India. His areas of expertise in SAP technologies include Netweaver Development Infrastructure (NWDI), WebDynpro Java, Composition Environment, and Enterprise Portal
Parallel Development and Concurrency Control in NWDI
SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com
© 2011 SAP AG 2
Table of Contents
Parallel Development and Concurrency Control ................................................................................................ 3
Introduction ..................................................................................................................................................... 3 Version Details: ............................................................................................................................................................ 3
Modification of a Resource by Multiple Users .................................................................................................... 3
Active Version ................................................................................................................................................. 4
User 1 Modifications ........................................................................................................................................ 5 Working Version of User 1 in Activity X ........................................................................................................................ 6
User 2 Modifications ........................................................................................................................................ 7 Working Version of User 2 in Activity Y ........................................................................................................................ 9
Consolidated Vantage Point of User 1 & User 2 before Check-in ................................................................ 10
Conflict Resolution ........................................................................................................................................ 11
Related Content ................................................................................................................................................ 15
Disclaimer and Liability Notice .......................................................................................................................... 16
Parallel Development and Concurrency Control in NWDI
SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com
© 2011 SAP AG 3
Parallel Development and Concurrency Control
Introduction
Concurrency control defines a controlled way of allowing multiple users to simultaneously access the same resource in the repository. Accessing a resource includes displaying, changing and deleting it. In this article we will see how multi-developer scenario works in NWDI and we will also see the different ways of modifying the resource. In this article, WebDynpro DC named “nwdiwd” that is present under the development configurations named “NWTRK” is considered as a target resource of modifications.
Version Details:
SAP NetWeaver Developer Studio (SAP NetWeaver 7.1 Composition Environment SP01 Enhancement Package 1).
NWDI 7.0
Modification of a Resource by Multiple Users
To modify a resource that is present in the DTR-Sever, it first needs to be Checked-Out from the DTR-Server to DTR-Client in the form of an “Activity”.
First time when an “Activity” is created it is in “Open” state. Open Activities are always associated with DTR-Client. Open activities are not available to other developers, not even for the same developer on other DTR-Client machine. To be more precise, Open Activities are strictly specific to the Local Machine's NWDS DTR-Client (their birthplace).
There are 3 ways in which a resource can be modified or Checked-out.
1. Checkout for Edit (Modifying the existing contents of resource).
2. Checkout for Add (Modifying the resource by adding new contents to it).
3. Checkout for Delete (Modifying the resource by deleting its content).
There are 2 main constraints that are defined in DTR for Concurrent access of the resource.
If one user has checked out a resource for deletion in a workspace, then no other user can check out the same resource for modification or for deletion in the same workspace.
Parallel Development and Concurrency Control in NWDI
SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com
© 2011 SAP AG 4
If one user has checked out a resource for modification in a workspace, then no other user can check out the same resource for deletion in the same workspace. But any other user can check out the resource for modification.
We will now see the examples illustrating 2 different developers modifying a common resource.
Active Version
The below figure illustrates the version graph a resource in DTR-Server. Version 1 is a closed version as it now replaced with the version 2, which is its successor version. Active Version implies that this version is available to other developers for syncing their local DTR-Client version to the active version in the DTR-Server.
Output of Currently Active Version in DTR
Below screenshot is showing the output of the same WebDynpro application explained in the Introduction part of this article. This Version is the Active version in DTR-Server.
In the next sections of this article we will see how 2 different Users load the same development configuration “NWTRK” and work on the same DC named “nwdiwd”.
Parallel Development and Concurrency Control in NWDI
SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com
© 2011 SAP AG 5
User 1 Modifications
Note: User 1 logs into NWDI for modifying the currently Active version of DTR.
Note: Text property is modified
Parallel Development and Concurrency Control in NWDI
SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com
© 2011 SAP AG 6
Note: The relevant files that will be affected as a result of this modification are checked out.
Note: Open Activity containing the modified files.
Working Version of User 1 in Activity X
Note: Output of the modification done by User 1
Note: Version 3 in Activity X, which is a current working version for User-1
Parallel Development and Concurrency Control in NWDI
SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com
© 2011 SAP AG 7
User 2 Modifications
Note: User 2 logs into NWDI for modifying the currently Active version of DTR.
Parallel Development and Concurrency Control in NWDI
SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com
© 2011 SAP AG 8
Note: Text property of the same resource that has already been checked out by User 1 is modified.
Note: The relevant files that will be affected as a result of this modification are checked out.
Note: User 2 adds a new view
Parallel Development and Concurrency Control in NWDI
SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com
© 2011 SAP AG 9
Note: All the relevant files that will be generated as a result of creating new view will be added to Activity
Note: New button is also added in the old view for navigating to newly created View
Working Version of User 2 in Activity Y
Note: Output of the modification done by User 2
Note: Version 3 in Activity Y, which is a current working version for User 2
Parallel Development and Concurrency Control in NWDI
SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com
© 2011 SAP AG 10
Consolidated Vantage Point of User 1 & User 2 before Check-in
1. The figure on the left side shows the version graph as „User-1‟ sees it after „User-2‟ checked out the resource. Version 2 is the current active version in the workspace. Version 3 in activity X is the current working version for „User-1‟.
2. The figure on the right side shows the version graph as „User-2‟ sees it after he or she checkes out the resource. Version 2 is the current active version in the workspace. Version 3 in activity Y is the current working version for „User-2‟.
User 1 Perspective User 2 Perspective
User 1 Perspective User 2 Perspective
Parallel Development and Concurrency Control in NWDI
SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com
© 2011 SAP AG 11
Note: Now User 1 Checks-In his/her Activity X, as a result of which Version 3 that was present in Activity X, now becomes the Active Version in the Inactive Workspace of DTR-Server.
Note: Now User 2 Checks In the Activity Y
Conflict Resolution
A check-in conflict occurs when the version that is being checked in is not a direct successor of the currently active version in the workspace. This can happen in the following case: 1. User 1 checks out a resource. 2. User 2 checks out the same resource. 3. User 1 makes the changes and checks in the activity. 4. User 2 makes the changes and tries to check in the activity.
The same above given scenario is simulated in this example, where after the Step-4 the User 2 will be reported with the Check-In Conflict, as shown below.
Parallel Development and Concurrency Control in NWDI
SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com
© 2011 SAP AG 12
Note: Check in Conflict is detected for User 2. Files highlighted in the screenshot are the conflicting files.
Note: User 2 Resolve the conflict one by one, by selecting Merge option for each conflicting files
Merging will show all the differences between “Remote Active Version” & the “Local Conflicting Version”.
Parallel Development and Concurrency Control in NWDI
SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com
© 2011 SAP AG 13
After clicking on “Yes” changes the content of local conflicting version & Remote Active version will be merged. If you click on No then the Local Changes will be discarded & and remote active version will remain unchanged.
Note: After User 2 resolves all the Conflicts, the user can check in the activity
Note: Now User 1 synchronizes his source code with the last checked in merged version of User 2.
Parallel Development and Concurrency Control in NWDI
SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com
© 2011 SAP AG 14
Note: The DTR-Client Source Code of User 1 is now updated, with the latest modification checked in by User 2
Parallel Development and Concurrency Control in NWDI
SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com
© 2011 SAP AG 15
Related Content
NWDI Empowered Landscape vs. Landscape without NWDI Setup
SAP NETWEAVER DEVELOPMENT INFRASTRUCTURE
NWDI-based Development Process
Migrating Local Developments to a Centralized NWDI Environment (Developer''s Viewpoint)
Best Practices for NWDI: Track design for ongoing development
For more information, visit the Repository-based Modeling and Design homepage.
Parallel Development and Concurrency Control in NWDI
SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com
© 2011 SAP AG 16
Disclaimer and Liability Notice
This document may discuss sample coding or other information that does not include SAP official interfaces and therefore is not supported by SAP. Changes made based on this information are not supported and can be overwritten during an upgrade.
SAP will not be held liable for any damages caused by using or misusing the information, code or methods suggested in this document, and anyone using these methods does so at his/her own risk.
SAP offers no guarantees and assumes no responsibility or liability of any type with respect to the content of this technical article or code sample, including any liability resulting from incompatibility between the content within this document and the materials and services offered by SAP. You agree that you will not hold, or seek to hold, SAP responsible or liable with respect to the content of this document.