This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 93982 - Diagram is displayed in readonly mode after deploying to server
Summary: Diagram is displayed in readonly mode after deploying to server
Status: VERIFIED FIXED
Alias: None
Product: soa
Classification: Unclassified
Component: BPEL Project (show other bugs)
Version: 5.x
Hardware: All All
: P2 blocker (vote)
Assignee: Denis Anisimov
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-02-02 13:01 UTC by Mikhail Kondratyev
Modified: 2007-02-27 10:53 UTC (History)
3 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Mikhail Kondratyev 2007-02-02 13:01:18 UTC
Steps to reproduce:
 - create new BPEL Sync sample project
 - DO NOT open the diagram
 - deploy the project
 - open the BPEL diagram
 - try to drag an activity from palette to the diagram - the diagram will be in
readonly mode, special message will be displayed and no editing will be allowed
Comment 1 Alexey Anjeleevich 2007-02-05 16:11:28 UTC
Model which is used to deploy BPEL on server has ModelSource with editable flag
FALSE. After deployment it is impossible to obtain model which has ModelSource
with editable flag TRUE.
Comment 2 Sergey Lunegov 2007-02-05 16:29:00 UTC
Mikhail,

would you please check when this issue was introduced into Gavotte
Comment 3 Mikhail Kondratyev 2007-02-05 16:43:15 UTC
This was reproducible in Coke already (I rechecked today). 
We could see Readonly diagram several times when doing Coke release and this was
discussed with Mike Frisino but the exact steps to reproduce were not known. 

Actually I was sure there was an issue filed for Coke for this but I could not
find it. I decided to create a new issue when we found out the scenario to
reproduce the problem
Comment 4 Nam Nguyen 2007-02-05 18:06:31 UTC
Based on the test case steps, my guess is that deployment invoke some validation
*ant task* which causing loading of ReadOnlyAccess model.  Maybe this read-only
model is still in cache when subsequent call to getModel() from the *editor*
return the same ReadOnlyAccess model.

If this theory is true, try calling AbstractModelFactory.createFreshModel()
instead of getModel() in the ant task code.  This will not cache the model.
Comment 5 Jun Qian 2007-02-05 20:39:05 UTC
CompApp Project does not load BPEL model in its own ant task. However, at
CompApp build time, it invokes the "dist_se" ant task from BPEL projet, which
seems to load the BPEL model in readonly mode.

To reproduce this problem without CompApp being involved, do the following:
  1. Create new BPEL SynchrousSample Project,
  2. Go to Files tab,
  3. Select build-impl.xml under BPEL project's nbproject directory,
  4. Invoke the Run Target->Other Targets->dist_se action from the context menu,
  5. Open the BPEL diagram
  6. Try to drag an activity from palette to the diagram - the diagram is in
read-only mode.

Reassigning to BPEL project...
Comment 6 Sergey Lunegov 2007-02-06 10:01:21 UTC
Alexey do you have enough information to fix the bug ?
Comment 7 Alexey Anjeleevich 2007-02-06 14:10:05 UTC
Yes. Described scenario reproduces bug.
Comment 8 Denis Anisimov 2007-02-07 11:29:54 UTC
The problem is exactly in loading bpel model in RO mode.
After this load BpelModel is cached and subsequent access to model
via model source returns RO Model.

This situation is common. So I suggest to correct ModelAccessProvider
implementation in the way of returning different keys for ModelSource that 
are readonly and writable ( but was created with the same DataObject f.e. ).
Such correction will fix any possible problem with performance and cached models.

Nam, could you please review this suggestion.
If my suggestion doesn't work for some reason for you then I will just change
implementation of Bpel Model Factory in that way.
But I prefer to do this in XAM level due general situation.
Comment 9 Nam Nguyen 2007-02-07 16:34:59 UTC
I has been thinking about the this bug.  The cache has no distinction b/w
readonly and writable instances.  Will address this.  Denis suggestion on the
key is on the right track.
Comment 10 Denis Anisimov 2007-02-07 17:09:46 UTC
One more thing here actually.

My suggestion will introduce another problem that we need to handle also and
this already should be done on deploy side.
Here is situation:
Deploy will ask model with RO ModelSource and get it.
DataObject will ask model with RW Model source and get another OM.
Design allow to modify RW model and it can be changed. But in the same 
time RO model is not modified. So RO model will be always in the state of
first creation. So deploy task will always use original OM but not current.
This is a problem.

Nam, could you provide to me details about possibility to ask Model via RW 
model source? What will happen if I try to get OM with RW ModelSource, but
there is no RW Providers ? Will I get in this case null or some exception 
occurs ?

I think we need to rewrite deploy task in the way always asking RW Model
and if it is not possible then asking RO Model.
Comment 11 Nam Nguyen 2007-02-07 17:38:08 UTC
The cached RO model should be refreshed with changed from Design because build
should have saved the buffer.  However, it would be more efficient if in-IDE
deploy and design use the same model.  So, for now please forget about 2-keys
solution.  

Can you change such that deploy create model source with writable flag. 
Remember the semantics of the editable flag in ModelSource is that in general,
only auto-downloaded model sources (in temp directory) should be mark as
non-editable.  All model sources part of project source should be obtained with
editable flag, even in ant task.
Comment 12 Denis Anisimov 2007-02-07 17:43:17 UTC
Thanks Nam,
we will do it.
Comment 13 Alexey Anjeleevich 2007-02-08 13:42:17 UTC
Fixed. Now in ../anttasks/.../IDEBPELCatalogModel.java is obtained from editable
model source.
Comment 14 Victoria Zhukovskaya 2007-02-27 10:53:08 UTC
WinXp build 070226_1