Please use the Apache issue tracking system for new NetBeans issues ( !!
Bug 196767 - StackDataStorage doesn't use passed contextID.
StackDataStorage doesn't use passed contextID.
Product: cnd
Classification: Unclassified
Component: D-Light
PC Solaris
: P1 (vote)
: 7.0
Assigned To: Maria Tishkova
Depends on:
  Show dependency treegraph
Reported: 2011-03-16 12:19 UTC by Andrew Krasny
Modified: 2011-03-18 17:27 UTC (History)
0 users

See Also:
Issue Type: DEFECT

Proposed patch (4.11 KB, text/plain)
2011-03-16 12:51 UTC, Maria Tishkova
corrected patch: added context id in FuctionImpl (4.11 KB, patch)
2011-03-16 14:03 UTC, Maria Tishkova
Details | Diff
file corrected (13.16 KB, patch)
2011-03-16 14:05 UTC, Maria Tishkova
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Andrew Krasny 2011-03-16 12:19:03 UTC
StackDataStorage doesn't use passed contextID for calculating functionid => functions (and metrics) from different contexts (processes, for example) get mixed. 

It is important to fix this for solstudio..
Comment 1 Maria Tishkova 2011-03-16 12:51:07 UTC
Created attachment 107044 [details]
Proposed patch

The patch is save for the NetBeans functionality. We will only put additional column to the database and will change the id generation. For all parts in CND which uses  StackStorage there will be no changes as context_id = -1 is used when put sample to the database
Comment 2 Maria Tishkova 2011-03-16 14:03:41 UTC
Created attachment 107051 [details]
corrected patch: added context id in FuctionImpl

in the previous patch only INSERT was changed, in the latest also SELECT
Comment 3 Maria Tishkova 2011-03-16 14:05:58 UTC
Created attachment 107052 [details]
file corrected

file corrected
Comment 4 Maria Tishkova 2011-03-16 16:20:14 UTC
this fix is required for DLight Tool and Analytics (part of Studio release)
Comment 5 Andrew Krasny 2011-03-17 13:39:27 UTC
Thanks. The last proposed fix seems to be OK with some notes:
in generateFuncId() last block should be:

        synchronized (funcCache) {
            String id = context_id + funcName;
            Long funcId = funcCache.get(id);
            if (funcId == null) {
                funcId = ++funcIdSequence;
                AddFunctionRequest cmd = requestsProvider.addFunction(funcId, funcName, source_file_index, line_number, context_id);
                funcCache.put(id, funcId);
            return funcId;
Comment 6 Maria Tishkova 2011-03-17 13:47:59 UTC
Fixed in cnd-main

(this fix includes additional fix suggested by Andrew)

Please verify. To verify you just need to check if Gizmo works
Comment 7 Alexander Pepin 2011-03-17 16:13:18 UTC
verified in dev build #4987
Comment 8 Andrew Krasny 2011-03-18 07:09:21 UTC
transplanted from cnd-main:
daef063de372 transplanted to f8b8eec06d2d
Comment 9 Quality Engineering 2011-03-18 09:46:47 UTC
Integrated into 'main-golden', will be available in build *201103180400* on (upload may still be in progress)
User: Maria Tishkova <>
Log: BZ#196767 - StackDataStorage doesn't use passed contextID
Comment 10 Alexander Pepin 2011-03-18 17:27:11 UTC
verified in rc1 build 20110318

By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2014, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo