You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-user@db.apache.org by "Curry, David CIV NAVAIR 41K300D" <da...@navy.mil> on 2008/08/07 19:47:30 UTC

Seg file not updating?

Vista, NetBeans 6.0, using embedded Derby driver.

I have 2 apps that share a database.  admin.jar is the admin app,
demo.jar is a simple client that cannot change data in the database.
Both apps are in the same folder, along with the database folder.

When I make data changes to the db using admin, and close admin and run
demo, I can see the data changes, no problem.

But when I look at seg\files, none of them have had their
modified/accessed timestamps updated.  The log file does have the
timestamp updated.  When I examine the seg\file that I know should have
the new data, it does not, but the log file does have the new data.  

Now, I have made data changes and seen the seg\file updated - that's how
I knew which seg\file was storing that particular piece of data - and no
other seg\files change when I change that data, so I'm quite confident
about this.  The weird part is that sometimes the seg\file WILL update
several minutes after closing admin - just POOF, it changes, timestamp
and all.

I read that sometimes the JVM hangs around and keeps the derby driver
alive, so the buffers aren't getting flushed.  I added a windowClose
handler, and I call System.gc() to force garbage collection, but that's
specious at best, and doesn't seem to have any effect.

I'm concerned that I, when I close admin, I am leaving changes pending
in the log file, not yet committed to the seg\file.  This might be a
problem if I want to copy the database folder back to the netbeans derby
folder so that I can add a field.  Will I lose the data changes I made
using admin?

Has anyone else seen this type of behavior?  Is it a problem?

TIA,
Dave



RE: Seg file not updating?

Posted by "Curry, David CIV NAVAIR 41K300D" <da...@navy.mil>.
Øystein,
Thanks, figured that out last week, posted an update you might not have seen.  That was it, sure enough.
Dave

________________________________

From: Øystein Grøvlen [mailto:Oystein.Grovlen@Sun.COM]
Sent: Tue 8/12/2008 11:57 PM
To: Derby Discussion
Subject: Re: Seg file not updating?



Curry, David CIV NAVAIR 41K300D wrote:
> Vista, NetBeans 6.0, using embedded Derby driver.
>
> I have 2 apps that share a database.  admin.jar is the admin app,
> demo.jar is a simple client that cannot change data in the database. 
> Both apps are in the same folder, along with the database folder.
>
> When I make data changes to the db using admin, and close admin and run
> demo, I can see the data changes, no problem.
>
> But when I look at seg\files, none of them have had their
> modified/accessed timestamps updated.  The log file does have the
> timestamp updated.  When I examine the seg\file that I know should have
> the new data, it does not, but the log file does have the new data.

Have you made sure to properly shut down the database before exiting the
  admin app?  Before exiting the application that embeds Derby, you
should connect to it with connection parameter 'shutdown=true'.  E.g.:

     DriverManager.getConnection("jdbc:derby:;shutdown=true");

Derby will as part of the shutdown force the database buffer to disk.

--
Øystein



Re: Seg file not updating?

Posted by Øystein Grøvlen <Oy...@Sun.COM>.
Curry, David CIV NAVAIR 41K300D wrote:
> Vista, NetBeans 6.0, using embedded Derby driver.
> 
> I have 2 apps that share a database.  admin.jar is the admin app, 
> demo.jar is a simple client that cannot change data in the database.  
> Both apps are in the same folder, along with the database folder.
> 
> When I make data changes to the db using admin, and close admin and run 
> demo, I can see the data changes, no problem.
> 
> But when I look at seg\files, none of them have had their 
> modified/accessed timestamps updated.  The log file does have the 
> timestamp updated.  When I examine the seg\file that I know should have 
> the new data, it does not, but the log file does have the new data. 

Have you made sure to properly shut down the database before exiting the 
  admin app?  Before exiting the application that embeds Derby, you 
should connect to it with connection parameter 'shutdown=true'.  E.g.:

     DriverManager.getConnection("jdbc:derby:;shutdown=true");

Derby will as part of the shutdown force the database buffer to disk.

-- 
Øystein