Issue 85133 - Mail Merge Issue using datasource - csv file locks
Summary: Mail Merge Issue using datasource - csv file locks
Status: ACCEPTED
Alias: None
Product: Writer
Classification: Application
Component: code (show other issues)
Version: OOo 2.3.1
Hardware: All Windows XP
: P3 Trivial with 10 votes (vote)
Target Milestone: ---
Assignee: AOO issues mailing list
QA Contact:
URL:
Keywords:
: 77697 (view as issue list)
Depends on:
Blocks:
 
Reported: 2008-01-10 10:26 UTC by forwarn
Modified: 2017-05-20 11:18 UTC (History)
7 users (show)

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


Attachments
Patch fixing the lock on data source files (602 bytes, patch)
2008-10-03 13:42 UTC, mloiseleur
no flags Details | Diff
Use case covering various database field type (54.45 KB, application/octet-stream)
2008-10-06 10:19 UTC, mloiseleur
no flags Details
Remove lock without losing anything (1.30 KB, patch)
2009-03-05 14:10 UTC, mloiseleur
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this issue.
Description forwarn 2008-01-10 10:26:38 UTC
I am writing to report a bug that we have experienced within our firm of 200 
users.  This is in both OpenOffice 2.0.2 and OpenOffice 2.3 - I expect it is 
probably a problem in all the versions.

We have created a datasource (an odb file) that points to a csv file.  We have 
some templates (ott files) that have fields inserted from the datasource.

Our users press F4 to launch the datasource window.  Select the option to merge 
data to fields, check that the document looks correct and then print it.  When 
they print the document a message appears asking if the user wants to print a 
form letter.  If the user clicks No, then the document prints fine, they can 
close the document and the csv file can be edited again.  This is all fine and 
expected.

The problem is if the user does the above and clicks Yes.  The document prints, 
the document is then closed by the user but the csv file remains locked by 
OpenOffice.  The csv file cannot be edited.  Closing OpenOffice and the 
Quickstarter usually releases the lock on the csv file and then it can be 
edited.  On occasion, a full restart of the PC is required to release this lock.

This is a problem for us as we use the csv file as part of a merge process for 
creating many of our documents. Also, our secretaries can have several 
documents open, and it is time consuming to have to close and re-open 
OpenOffice.

Regards
Karl Handley
Comment 1 michael.ruess 2008-01-10 10:55:03 UTC
Reassigned to HI.
Comment 2 adamthorne 2008-01-10 12:26:11 UTC
I am writing to confirm and expand on this issue where OO2.3 is being used in a
similar situation. We have an OO datasource setup that points to a txt file in
user relative locations. This has been tested extensively and on the .txt
datasource the file locking occurs both on using the Merge Wizard and the Print
Form Letter process. Similarly the file is not unlocked for rewriting until the
soffice.bin process is ended. 

OO: 2.3.0
O/S: Win Server 2003
Comment 3 adamthorne 2008-01-10 12:27:41 UTC
I am writing to confirm and expand on this issue where OO2.3 is being used in a
similar situation. We have an OO datasource setup that points to a txt file in
user relative locations. This has been tested extensively and on the .txt
datasource the file locking occurs both on using the Merge Wizard and the Print
Form Letter process. Similarly the file is not unlocked for rewriting until the
soffice.bin process is ended. 

OO: 2.3.0
O/S: Win Server 2003
Comment 4 h.ilter 2008-04-09 10:36:17 UTC
HI->OS: Confirmed, file closed after mailmerge but database is still locked.
Occurs also in OOo 2.4
Comment 5 Oliver Specht 2008-05-27 13:34:18 UTC
Changing target milestone to 3.x
Comment 6 Oliver Specht 2008-06-18 06:46:53 UTC
*** Issue 77697 has been marked as a duplicate of this issue. ***
Comment 7 camillem 2008-09-01 14:22:21 UTC
The problem seemed fixed in OOo-dev 3.0.0 OOO300m3 (Build:9344) (at least in our
environment) but reappeared in OOo-dev 3.0.0 OOO300m4 (Build:9347).
Could we have more info about that?
Comment 8 mloiseleur 2008-10-03 13:42:46 UTC
Created attachment 56993 [details]
Patch fixing the lock on data source files
Comment 9 mloiseleur 2008-10-03 13:55:16 UTC
Hi,

   here's more information for this patch. The patch remove the GetFmt method
which is guilty for keeping a persistent connection after the mail merge operation. 
   I didn't have the time to pursue any further, but since this method seems
useless in a MailMerge Context, I deactivated it. Every single field mapped are
converted into String in order to get used in the Writer document. 

  I have tested MailMerge on different datasources, mainly : CSV, XLS, hSQLdb.
The removal of those 2 lines did not affect any of them.  
  But now, our users can edit a csv files & dynamically redo a mail merge
without closing every single window of OpenOffice.org. It works like a charm.

  Would you please tell us if and when the patch can be integrated into mainline ? 

Thanks,
Comment 10 max.odendahl 2008-10-03 14:19:24 UTC
->mloiseleur: you have to switch to PATCH as well
Comment 11 mloiseleur 2008-10-04 12:48:00 UTC
Adding me to cc
Comment 12 Oliver Specht 2008-10-06 07:52:02 UTC
->mloiseleur: If the problem is in SwNewDBMgr::GetColumnFmt() then you shouldn't
remove the use of this method. 
What you removed is necessary to set the number format of database fields if
they don't have their own format setting and the database provides one. 
And the fact that fields are converted to text (sometimes but not always)
doesn't make a difference. 
Comment 13 mloiseleur 2008-10-06 08:12:03 UTC
-> os : That's what I think first, but I didn't manage to create a use case
where it was clearly necessary. Can you provide one ? or explain to me how can I
create one ? 
  We have tried to put date & number fields of various kind from an hslqdb and
there were no problem so far. Is there a special method to input them ?

Thanks,
Comment 14 Oliver Specht 2008-10-06 09:12:35 UTC
->mloiseleur: You can apply the number format while you edit the .odb database
file. If you edit the db table there is a field properties section at the bottom.
Comment 15 mloiseleur 2008-10-06 10:19:16 UTC
Created attachment 57016 [details]
Use case covering various database field type
Comment 16 mloiseleur 2008-10-06 10:22:57 UTC
-> os : Thanks. I've tested various kind of database field. All
numeric/boolean/date/time works the same with or without my patch. They all
merge fine & the resulting document is OK.

  Binary field (images) does not map at all, with or without my patch so I guess
I cannot map them ATM. 

  Would you please be more precise about the problem you described ? Maybe
enchance attached test case ?

Thanks,
Comment 17 Oliver Specht 2009-01-30 10:51:52 UTC
Target changed to 3.2
Comment 18 mloiseleur 2009-03-05 14:10:55 UTC
Created attachment 60746 [details]
Remove lock without losing anything
Comment 19 mloiseleur 2009-03-05 14:13:20 UTC
Hi os,

   I've finally encountered the problem you described, so I was able to improve
my patch. If you take a look at "sw-remove-csv-lock.diff", I am quite confident
that you won't see any problem for its inclusion.

Regards,
Comment 20 Oliver Specht 2009-03-05 14:23:47 UTC
accepted
Comment 21 Oliver Specht 2009-06-18 09:58:07 UTC
Integrated in cws os132
Comment 22 Oliver Specht 2009-07-13 14:58:49 UTC
Reassigned for verification
Comment 23 cno 2009-07-13 16:49:14 UTC
@ hi: could it be possible, while checking this, to take the scenario from issue
103498 also into consideration?
Thanks - Cor
Comment 24 h.ilter 2009-07-14 15:19:17 UTC
Verified with cws os132 =  file locking is still reproducible for a *.csv and for the attached *.odb file.
Comment 25 h.ilter 2009-07-14 15:23:44 UTC
We may should summarize this issue for any kind of database file
Comment 26 Oliver Specht 2009-09-30 09:32:03 UTC
Target changed to 3.x
Comment 27 cno 2009-10-14 11:16:16 UTC
@os, hi: Although the patch does not (according to tests) solve the problem with
all file types, would it be possible to 
 - accept what works
and
 - create a new issue for the file type(s) that need additional work.
Step by step improvement also is appreciated.
Comment 28 Oliver Specht 2009-10-14 11:52:10 UTC
->cornouws: The patch has been integrated. 
Only the issue has been removed from the cws.
Comment 29 Marcus 2017-05-20 11:18:04 UTC
Reset assigne to the default "issues@openoffice.apache.org".