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 24216 - CRASH: Several MdrStorages accessing the same BTreeStorage
Summary: CRASH: Several MdrStorages accessing the same BTreeStorage
Status: RESOLVED WONTFIX
Alias: None
Product: java
Classification: Unclassified
Component: Unsupported (show other bugs)
Version: 3.x
Hardware: PC Linux
: P4 blocker (vote)
Assignee: Daniel Prusa
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2002-05-29 22:12 UTC by _ hkrug
Modified: 2010-09-23 09:03 UTC (History)
0 users

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 _ hkrug 2002-05-29 22:12:40 UTC
It is very simple to crash Netbeans when opening
two
instances of the MDR explorer view and
manipulating them
independenty.

The reason is, that the MDR managers and factories
allow to
create two independent MdrStorages accessing the
same
persistent storage, in such a way circumventing
the transaction
management implemented in MdrStorage.

A solution to this problem probably would be to
make the constructor
of MdrStorage private and use a factory method for
MdrStorage
creation. The factory methods looks up if a
MdrStorage for the
given persistent location already exists. If so,
it is returned, only 
otherwise, a new MdrStorage is created.

More precise:

Add `Map instances;' to MdrStorage.
`instances' maps instances of classes implementing
`StorageFactory' to instances of MdrStorage. The
`StorageFactory' implementations
in a similar way hash their instances to return
identical instances
for similar parameter settings.

I could provide a patch following the
aforementioned lines. If the
aforementioned lines are not OK, please tell me,
what approach
will be taken to solve the problem. I need to
know, if the problem
will be solved or if I have to circumvent it for
my own.

Please tell me, if I shall provide a patch. I
would be delighted to do so.
Comment 1 _ hkrug 2002-05-29 22:23:31 UTC
I just saw:

/** instances of MdrStorage by storage ID */
    private static final Hashtable instances = new Hashtable();

is already part of MdrStorage.
Comment 2 _ briansmith 2002-07-21 01:25:27 UTC
I would like MDR to lock the B-Tree files to prevent multiple
processes from accessing them at once.

Use case: I have some command-line tools that use MDR. Sometimes, I
would like to use MDR Explorer to view the (intermediate) results of
my tools' actions. In this case, I need MDR Explorer and my tools to
operate on the same repository and thus the same B-Tree files. But,
often I forget to close NetBeans/MDR Explorer before running my
command-line tools. And, as a result the repository seems to get
corrupted.
Comment 3 Martin Matula 2002-07-22 11:47:39 UTC
Dan, could you please look at it? Thanks.
Comment 4 David Strupl 2010-09-23 09:03:17 UTC
I am closing all reports in category Java/Unsupported as wontfix. These should be dead issues --- if the reported cases are against some live part of the NetBeans IDE please reopen and we can discuss to which category they belong.