Apache OpenOffice (AOO) Bugzilla – Issue 85133
Mail Merge Issue using datasource - csv file locks
Last modified: 2017-05-20 11:18:04 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
Reassigned to HI.
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
HI->OS: Confirmed, file closed after mailmerge but database is still locked. Occurs also in OOo 2.4
Changing target milestone to 3.x
*** Issue 77697 has been marked as a duplicate of this issue. ***
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?
Created attachment 56993 [details] Patch fixing the lock on data source files
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,
->mloiseleur: you have to switch to PATCH as well
Adding me to cc
->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.
-> 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,
->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.
Created attachment 57016 [details] Use case covering various database field type
-> 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,
Target changed to 3.2
Created attachment 60746 [details] Remove lock without losing anything
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,
accepted
Integrated in cws os132
Reassigned for verification
@ hi: could it be possible, while checking this, to take the scenario from issue 103498 also into consideration? Thanks - Cor
Verified with cws os132 = file locking is still reproducible for a *.csv and for the attached *.odb file.
We may should summarize this issue for any kind of database file
Target changed to 3.x
@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.
->cornouws: The patch has been integrated. Only the issue has been removed from the cws.
Reset assigne to the default "issues@openoffice.apache.org".