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 203381 - Database Connections disappear
Summary: Database Connections disappear
Status: RESOLVED FIXED
Alias: None
Product: db
Classification: Unclassified
Component: Code (show other bugs)
Version: 7.0.1
Hardware: PC Windows Vista
: P2 normal with 1 vote (vote)
Assignee: Jaroslav Havlin
URL:
Keywords:
: 208943 209788 210685 (view as bug list)
Depends on:
Blocks:
 
Reported: 2011-10-09 04:24 UTC by bht
Modified: 2012-04-26 10:30 UTC (History)
5 users (show)

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 bht 2011-10-09 04:24:54 UTC
I haven't watched this closely so I cannot say when exactly this happened, but it happened many times with Version 7.01.

Now I just see it again - I have been working with 7.1 beta for a few days with  settings imported from 7.01 and I realised the connections were not imported. Please see issue 203378.

So I closed the beta and opened 7.01, and four server based connections were gone, one mysql, one postgresql and two javadb - samples dayabase and jdbc default.

One additional connection still exists, one that I created recently, a hsql file connection.

I just don't have the stamina anymore to lose the data all the time - this is too much of a moving target with beta testing in parallel.
Comment 1 Jiri Rechtacek 2011-10-09 15:17:44 UTC
(In reply to comment #0)
> I haven't watched this closely so I cannot say when exactly this happened, but
> it happened many times with Version 7.01.
I need more details about your problem: your messages.log from a session when connections disappeared. A lack of data to evaluate the problem.

> Now I just see it again - I have been working with 7.1 beta for a few days with
>  settings imported from 7.01 and I realised the connections were not imported.
> Please see issue 203378.
> 
> So I closed the beta and opened 7.01, and four server based connections were
> gone, one mysql, one postgresql and two javadb - samples dayabase and jdbc
> default.
The right time to catch your messages.log.

> One additional connection still exists, one that I created recently, a hsql
> file connection.
> 
> I just don't have the stamina anymore to lose the data all the time - this is
> too much of a moving target with beta testing in parallel.
It's not possible. Import from NB7.0.1 to NB7.1Beta cannot modify the NB7.0.1 userdir, running both IDEs in parallel cannot modify NB7.0.1 userdir neither.
Comment 2 bht 2011-12-20 17:24:54 UTC
Lost all connections after having to kill the IDE when it froze:
http://netbeans.org/bugzilla/show_bug.cgi?id=206565

Product Version: NetBeans IDE 7.1 RC1 (Build 201111242103)
Java: 1.6.0_25; Java HotSpot(TM) Client VM 20.0-b11
System: Windows XP version 5.1 running on x86; Cp1252; en_NZ (nb)

Log file attached to the other bug.
Comment 3 bht 2011-12-20 18:03:48 UTC
I have these files in
C:\Documents and Settings\name\.netbeans\7.1rc1\config\Databases\Connections

C:\Documents and Settings\name\.netbeans\7.1rc1\config\Databases\Connections\jdbc_postgresql___localhost_5432_2.xml
C:\Documents and Settings\name\.netbeans\7.1rc1\config\Databases\Connections\jdbc_derby___localhost_1527_samp.xml
C:\Documents and Settings\name\.netbeans\7.1rc1\config\Databases\Connections\jdbc_derby___localhost_1527_samp_1.xml
C:\Documents and Settings\name\.netbeans\7.1rc1\config\Databases\Connections\jdbc_derby___localhost_1527_test.xml
C:\Documents and Settings\name\.netbeans\7.1rc1\config\Databases\Connections\jdbc_derby___localhost_1527_test_1.xml
C:\Documents and Settings\name\.netbeans\7.1rc1\config\Databases\Connections\jdbc_hsqldb_file_c__prog_jtracda_1.xml
C:\Documents and Settings\name\.netbeans\7.1rc1\config\Databases\Connections\jdbc_mysql___localhost_3306_drup.xml
C:\Documents and Settings\name\.netbeans\7.1rc1\config\Databases\Connections\jdbc_mysql___localhost_3306_mysq.xml
C:\Documents and Settings\name\.netbeans\7.1rc1\config\Databases\Connections\jdbc_postgresql___localhost_5432.xml
C:\Documents and Settings\name\.netbeans\7.1rc1\config\Databases\Connections\jdbc_postgresql___localhost_5432_1.xml

They are all emty (0 legth) but they don't have recent modification dates.

I think we need a better approach to this.

I need to know what data to record, especially in a crash.

Meanwhile, I think there is enough data to say that there is data loss because these files are being touched without any reason.
Comment 4 bht 2012-01-12 18:23:27 UTC
It happened again without crash - the connections just all disappeared.

Could it be that the IDE is managing these files incorrectly?

In an old 7.01 copy that still contains connections, I can see two files for the same conection
jdbc_derby___localhost_1527_samp.xml (0 bytes)
jdbc_derby___localhost_1527_samp_1.xml (466 bytes)

This doesn't look right.
Comment 5 Jiri Rechtacek 2012-01-13 07:41:12 UTC
(In reply to comment #4)
> It happened again without crash - the connections just all disappeared.
Spontaneously w/o any user action? Interesting.

> Could it be that the IDE is managing these files incorrectly?
Probably.

> In an old 7.01 copy that still contains connections, I can see two files for
> the same conection
> jdbc_derby___localhost_1527_samp.xml (0 bytes)
> jdbc_derby___localhost_1527_samp_1.xml (466 bytes)
> 
> This doesn't look right.
It doesn't. Could you reproduce it again with fresh userdir?
Comment 6 bht 2012-01-13 08:41:44 UTC
I wasn't precise with my last observation. There is basically not a new aspect of the issue. I should say:

In an old 7.01 copy that still contains connections, I can see two files for
two conections to the same database:
jdbc_derby___localhost_1527_samp.xml (0 bytes)
jdbc_derby___localhost_1527_samp_1.xml (466 bytes)

These are for the same database but each with a different schema, therefore the naming makes sense. What this reveals though is that the problem existed in 7.01 before I even noticed. I have also re-installed a newer operating system Win XP (which was Win2k when using 7.01) on a new hard disk. So yes, this is strange, and yes, I lost all connections once again.

I cannot reproduce this on demand yet because I have seen this only once without a crash. Meanwhile I have cleaned up the Connections directory, and made an external backup of it. Now I will hopefully start watching the directory with something like "Watch 4 Folder" so I get a pop-up window on file changes. I mark this RESOLVED INCOMPLETE until I find better evidence.
Comment 7 bht 2012-01-14 02:16:43 UTC
My observations:
- Whenever a database connection is opened the following happens:
  - The connection file is always touched (modified)
  - Often an unrelated connection file is modified with 0 length
- At the end of each NetBeans shutdown:
  - NetBeans always touches (modifies) files of all connections that are not yet corrupted (non-0-length connection files)

In none of the above cases, any content was modifed except when unnecessarily deleted. That is because I did not touch the connection properties.

This behavior virtually guarantees that finally all connection files will be corrupted.

It looks like a generic problem while its manifestation is probably Windows-specific.

You can reproduce this on Windows XP with the utility "Watch 4 Folder". Just create a handful of database connection. and watch. In my case, the utility works best with just watching the database folder for modification not the individual files.
Comment 8 bht 2012-01-21 23:58:04 UTC
The IDE nulled jdbc_postgresql___localhost_5432.xml at a regular shutdown of a four hour session where the postgresql server wasn't started, and the db explorer was not used during that session.
Comment 9 Jiri Rechtacek 2012-02-28 12:46:10 UTC
*** Bug 208943 has been marked as a duplicate of this bug. ***
Comment 10 Jan Peska 2012-04-19 13:49:48 UTC
*** Bug 210685 has been marked as a duplicate of this bug. ***
Comment 11 Jaroslav Havlin 2012-04-25 11:57:32 UTC
- Disappearing connections solved in bug 210279.
- Refreshing (and collapsing) of nodes fixed in
  http://hg.netbeans.org/core-main/rev/dfe382261f7b

Please reopen if some problems remain.
Thank you for reporting.
Comment 12 Jaroslav Havlin 2012-04-25 15:30:54 UTC
*** Bug 209788 has been marked as a duplicate of this bug. ***
Comment 13 Quality Engineering 2012-04-26 10:30:32 UTC
Integrated into 'main-golden', will be available in build *201204260400* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/dfe382261f7b
User: Jaroslav Havlin <jhavlin@netbeans.org>
Log: #203381 - ConnectionList notifies listeners only when connections are added or removed