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.
Summary: | [65cat] SQL History: if running NB in multiple locales the history file cannot be parsed | ||
---|---|---|---|
Product: | db | Reporter: | John Baker <jbaker> |
Component: | SQL Editor | Assignee: | John Baker <jbaker> |
Status: | VERIFIED FIXED | ||
Severity: | blocker | CC: | hmichel, misterm, romanmostyka, sustaining |
Priority: | P2 | ||
Version: | 6.x | ||
Hardware: | All | ||
OS: | All | ||
Issue Type: | DEFECT | Exception Reporter: | |
Attachments: |
Updated changeset which cleanly applies on release65_fixes repo.
Log file... History file from 6.5 RC2 |
Description
John Baker
2008-11-06 08:13:00 UTC
Steps to reproduce: 1) Run NetBeans in some locale 2) Execute some SQL statements 3) Exit NetBeans, change locale, restart NetBeans 4) Try to open SQL History dialog opens empty, instead should see statements executed BTW, any chance to see it on a patch for 6.5? I am really afraid to lost my history time after time. Regards I just updating it for DEFECT since it is a problem, which cause data loss. John, I marked this issue as candidate for Patch 1. If you think that we won't be able to fix this issue till 10 November, please remove status whiteboard. 98a2eb9ab661 Once fix is available, previously executed statements won't be retained if they the date fails to parse (due to changing locales) After using a build with this patch, from then on, statements will be saved even if changing the locale hmichel, can You verify that this issue was really fixed? Please update this issue according to your results. Thanks. Which build could I use? Integrated into 'main-golden', will be available in build *200811071401* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main/rev/98a2eb9ab661 User: John Baker <jbaker@netbeans.org> Log: #152486 fix by persisting time in milliseconds > Integrated into 'main-golden', will be available in build *200811071401* on http://bits.netbeans.org/dev/nightly/
(upload may still be in progress)
I think the build will be available in 7-8hhrs, by 16:00
Please verify this issue so it can be included in NetBeans 6.5 Patch1 Created attachment 73870 [details]
Updated changeset which cleanly applies on release65_fixes repo.
hmichel could you please verify that this has been fixed by installing a nightly build http://bits.netbeans.org/download/trunk/nightly/latest/ Thank you No, it is not fixed. I got the attached exception. BTW, this exception just freeze the IDE and I needed to kill the IDE process. The problem is that I have a sql_history.xml file in the correct folder (imported by IDE during first start) and I can't see it anymore. The UI is clean when I open the SQL history. BTW, I just changed the IDE initial parameter to start with --locale en:US, and the history file I think was created in the pt:BR locale. The UI should be able to parse the history file already create, imagine the users using the IDE in different locales and now running this with the patch 1 or if the user copy the userdir for another workstation with different locale, this MUST work, the history must be available. Maybe the FCS should store this data always in a specific locale to avoid this kind of regression with the patch or next release. I increased to P1 since it causes data loss. Just to be clear, all the data in userdir, AFAIK, must not be locale dependent, so, I can copy these data from an workstation to another, or share this folder on my network, and be able to use it in any workstation I need. So, if it is not possible, we have another P1, since user lost data. Product Version: NetBeans IDE Dev (Build 200811170201) Java: 1.6.0_10; Java HotSpot(TM) Client VM 11.0-b15 System: Linux version 2.6.27-8-generic running on i386; ISO-8859-1; en_US (nb) Userdir: /home/hmichel/.netbeans/dev This fix enables switching locales. Use case that was fixed is .. 1) Run NetBeans in some locale 2) Execute some SQL statements 3) Exit NetBeans, change locale, restart NetBeans 4) Try to open SQL History The fix doesn't deal with moving the userdir or importing. That would be a separate issue. However, NetBeans probably wouldn't work if the user moved the userdir to another computer since the paths to settings may be different. If you think the userdir should be moved to another computer, please file a separate issue. Let's just deal with one thing at a time I don't see the new stack trace attached. Please verify the use case without moving the userdir 1) Run NetBeans in some locale 2) Execute some SQL statements 3) Exit NetBeans, change locale, restart NetBeans 4) Try to open SQL History Created attachment 73882 [details]
Log file...
Now it is attached. :) From the exception, it appears no SQL history was found - but this was after you moved the userdir to another computer? No, this happens when I import the settings from 6.1 version, which has no sql history support since it is a 6.5 feature. BTW, I tested with daily build and everything works fine, but, if I generate a history file on 6.5 RC2 in pt:BR locale, copy it for daily build user folder, run the IDE daily build in en:US and click on Apply button, I had this exception too. I marked this a fixed again please verify the use case by using one computer and not moving the userdir Please verify the use case without moving the userdir 1) Run NetBeans in some locale 2) Execute some SQL statements 3) Exit NetBeans, change locale, restart NetBeans 4) Try to open SQL History Thank you very much This use case works really fine, since now you store it as milliseconds, it works for any locale. I am really afraid about parsing files from FCS version, since this fix is just for patch 1. Regarding parsing the history file from FCS, you can try, but when changing locale, the history may get cleared. But there is no solution to retaining the history if you change locales. If the locale is kept the same then history from FCS should still be retained when using the 6.5 patch 1 I forgot to mention since the use case passes, please mark this issue as verified Just confirm it to me, the RC2 history file is the same that, in theory, FCS will generate? If yes, see the following use case: 1- Run some SQL statements on 6.5 RC2 in pt:BR locale; 2- Run some SQL statemets on daily build, just to create the folders on user folder; 3- Close all IDEs, and copy the history file from RC2 to daily build 4- Open daily build IDE and click on Apply button. You will see your IDE frozen and the exception I told you should be thrown on your messages.log file. If you think it is a valid use case, as I think, this issue should be reopened. Just in case, I will attach my RC2 history file. Created attachment 73885 [details]
History file from 6.5 RC2
Just to be clear, I don't agree with the approach decided here, where the history file is lost, or cleared if you prefer, if the locale is changed. For me it is a bad design and should be fixed, but I know, sadly, that this kind of issue will not stop the release, otherwise this kind of issue IMO is a P1 with the follow reason: user just can't trust in the tool. Oh I see! you just copied the sql_history.xml file. I thought you copied the whole userdir to another computer. I tried your use case and can reproduce. As I mentioned, unfortunately, the history file from R2 won't be recoverable for patch 1 the java.util.Date cannot be parsed if locale is changed. I might be able to replace the unparsable date with the current date. If this works then the history file shouldn't be lost. But, if you create the history file in patch 1 and switch locales then the history file should be retained and usable. When clicking the Apply button, I did reproduce the IDE freezing. I can reopen and try to improve the fix #672be402371c improved fix - set date to current timestamp if date is not parsable Hi John, I tested the patch sent by mail and everything works as described. Now I think we have a good fix. Thanks for your good work and quickly reply. Just fix this issue and I will mark this verified in the next build. Regards. John, just to answer your previous message, Yes, I copied the whole userdir too, I tested just switching locales and so on, and every this scenarios had the same result, so, I just sent you the easiest to reproduce. I will test the patch again with all scenarios is possible, but I really think it was fixed. Regards hmichel, can You take a look at this issue? This issue is P2 and is going to be included into NetBeans 6.5 Patch 1. Please make it VERIFIED till 27 November or update this issue with justification why the fix doesn't work till this date. Thanks. Could you point me out the correct build for tests? By default, I always wait for qa message about which build the issue is available. Integrated into 'main-golden', will be available in build *200811191401* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main/rev/672be402371c User: John Baker <jbaker@netbeans.org> Log: #152486 improved fix if date is not parsable, use current timestamp fix should be in this build http://bits.netbeans.org/download/trunk/nightly/2008-11-19_14-01-51/ (Issue shouldn't have been reopened) v. 200811200201 For me now it is safe to be merged with patch1 branch. I've ported the changeset http://hg.netbeans.org/main/rev/98a2eb9ab661 into release65_fixes repository as http://hg.netbeans.org/release65_fixes/rev/76c3c21de71f I've transplanted the changeset http://hg.netbeans.org/main/rev/672be402371c into release65_fixes repository as http://hg.netbeans.org/release65_fixes/rev/c790cdec96cd |