Issue 76738 - OOo does not discard changes when file is closed
Summary: OOo does not discard changes when file is closed
Alias: None
Product: Base
Classification: Application
Component: code (show other issues)
Version: OOo 2.2
Hardware: All Windows XP
: P4 Trivial (vote)
Target Milestone: ---
Assignee: AOO issues mailing list
QA Contact:
Depends on:
Reported: 2007-04-27 05:09 UTC by drewjensen.inbox
Modified: 2017-05-20 10:47 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Latest Confirmation in: ---
Developer Difficulty: ---

example databae (2.58 KB, application/vnd.sun.xml.base)
2007-04-27 05:10 UTC, drewjensen.inbox
no flags Details

Note You need to log in before you can comment on or make changes to this issue.
Description drewjensen.inbox 2007-04-27 05:09:32 UTC
Steps to reproduce.

Insure that Quickstarter is running

Open the attached file. 

Use the New Form Wizard to create a simple form based on table Assets

Close the new form

Close the Base file

OOo will display dialog box asking to Save, Discard or Cancel

Choose Discard

Now open the Base file again

The new form was not discarded. In fact the file is still 'Modified' as the save
icon is enabled. If you close the file now you will again be prompted to save,
discard or cancel.

If you exit OOo completely by closing Quicstarter then open the file once again
the form is now discarded and the save icon is now disabled.

To further test this I did the following: 

Made sure Quickstarter 2.3 was running

Opened the Base file, added the form, then closed the Base file telling OOo to
discard the changes

Switched to a different user account on the computer

Started OOo 2.2 stable and opened the same Base file ( Note, I checked that
there was no *.lck file left for this ODB file, there was none. )

The file is opened in read only mode, the form that was created in the prior
step is not visible.

Closed the Base file in OOo 2.2

Switched back to the first user session

Opened the Base file with OOo 2.3 again - the form is again displayed in the
forms list and the file is still marked as 'modified'.

Finally - I tried this with a Writer file also. This problem does not occur.
Comment 1 drewjensen.inbox 2007-04-27 05:10:24 UTC
Created attachment 44722 [details]
example databae
Comment 2 christoph.lukasiak 2007-04-30 13:04:01 UTC
i can repro that in a current version
Comment 3 drewjensen.inbox 2007-04-30 13:30:40 UTC
You are correct. Just tried this on 2.2 with the same results. Adjusting the
version information appropriately. 
Comment 4 Frank Schönheit 2007-05-02 08:41:40 UTC
P4 and OOo 2.x somehow contradict each other ...

The problem here is that the form wizard is written in Java, which
"unfortunately" has this thing called garbage collection. References to the
database document are not discarded when the wizard is finished, but only some
time later, when the JVM's garbage collection runs (which might be whenever).
Thus, the document is not really closed.

We currently have no mechanism in place to prevent this. Perhaps we should
declare the application window being the owner of the document. Currently, it is
not really, since it is allowed to programmatically obtain a document reference,
close the application, and continue working with the document. Not sure how to
best solve this.
Comment 5 drewjensen.inbox 2007-05-04 04:52:38 UTC
I'm not sure I follow you totally. After reading your explanation I tried the

Opened a Base file
Started the Form Wizard - did not finish
Closed the Base file
Yes the form wizard is still open and running, but you can't finish. 
There is no way to save the form. So what is the point, unless this be entered
as a new defect?

This is also a different behavior from when an existing form is opened for data
entry or in design mode. In either of those cases closing the Base file also
closes the form.
Comment 6 Frank Schönheit 2007-05-07 09:25:51 UTC
What you describe now is a different bug - you should not be able to close the
Base doc when the wizard is still running.

The original bug, as I understand it, means that after the wizard has run, the
Db doc is kept in memory, not discarding any changes, even if you close its UI.
Right? The note above was more a technical note about why this (probably)
happens: Because some Java object is still alive, and thus implicitly keeps the
DB doc alive.
Comment 7 Marcus 2017-05-20 10:47:36 UTC
Reset assigne to the default "".