Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 309325

Summary: Whole workspace is locked during JavaEEComponentExportOperation
Product: [WebTools] WTP Java EE Tools Reporter: Elson Yuen <eyuen7>
Component: jst.j2eeAssignee: Chuck Bridgham <cbridgha>
Status: RESOLVED WONTFIX QA Contact: Chuck Bridgham <cbridgha>
Severity: normal    
Priority: P3 CC: ccc, jsholl
Version: unspecified   
Target Milestone: 3.2.4   
Hardware: All   
OS: Windows XP   
Whiteboard:
Attachments:
Description Flags
v1.0 none

Description Elson Yuen CLA 2010-04-15 11:11:18 EDT
Build Identifier: 3.2 M7

When exporting an EAR file using the JavaEEComponentExportOperation, the entire workspace is being locked instead of the affected projects only.  When exporting an EAR, we should only lock the affect projects instead of the entire workspace. 

Fixing this problem will allow the user to continue to work on the un-affected project during the export operation.  This problem is also blocking server tools from implementing https://bugs.eclipse.org/bugs/show_bug.cgi?id=288863.

The problem looks like to be caused by:
org.eclipse.jst.j2ee.internal.archive.operations.ComponentExportOperation.getSchedulingRule()

In that method, it calculates the all the affected projects and combine the scheduling rule.  However, at the end, it does:
		combinedRule = MultiRule.combine(ruleFactory.buildRule(), combinedRule);

The ruleFactory is the workspace ruleFactory.  Therefore, the ruleFactory.buildRule() will returns R/ which forces locking the entire workspace. 


Reproducible: Always
Comment 1 Elson Yuen CLA 2010-04-15 11:14:57 EDT
Created attachment 164978 [details]
v1.0

Given that the affected project is already calculated earlier in the method, the adding of the build rule looks redundant.  Therefore, I am proposing to remove adding of the buildRule() in this patch.
Comment 2 Elson Yuen CLA 2010-04-15 14:08:38 EDT
Comment on attachment 164978 [details]
v1.0

After talking to Chuck, it turns out the export operation may be doing a build. I check the code and it is doing a build during the export.  This mean we cannot remove the build rule. Therefore, I am marking the patch as obsolete.
Comment 3 Carl Anderson CLA 2010-04-21 14:30:43 EDT
Assigning to Chuck for initial investigation.

I am not sure if we can do something about this before WTP 3.2 is released.
Comment 4 Chuck Bridgham CLA 2011-04-15 11:40:26 EDT
For the reason mentioned... The export operation requires a build - it must keep the build rule, and this will lock the entire workspace during execution.

This is not going to be changed... marking bug as won't fix