db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mike Matrigali <mikem_...@sbcglobal.net>
Subject Re: Derby db files get corrupted
Date Thu, 16 Feb 2006 17:28:44 GMT
what jvm was the problem encountered under, prior to jdk1.4.2 on some
OS/JVM combinations derby could not properly prevent 2 JVM's from
booting on the same db at that same time.  This could lead to all sorts
of problems.

As Knut points out any outside manipulation of the files in log or seg0
of the db will result in these kinds of errors.

so the 1st questions:
What JVM?
what OS?
what device is the db on (ie. ide disk on single machine, some sort of
shared disk across multiple machines).
Does that device have write cache enabled, which means derby can't
ensure proper syncing on the disk.
Any errors on that device?
Are there any boot warning messages in their derby.log files?
I was not clear from below, do multiple users use the same database -
possibly trying at the same time?

wegorkie@interia.pl wrote:

> Hi,
> 
> I use Derby in my product which is personal finance manager written in Java. The app
is standalone and has derby as embedded 
> 
> database which of course starts together with an app.
> 
> The version of derby.jar (from manifest) is:
> Bundle-Name: Apache Derby 10.1
> Bundle-Version: 10.1.1000000.208786
> 
> and I use embedded driver from the same jar:
> org.apache.derby.jdbc.EmbeddedDriver
> 
> Now. I have a serious problem. The application is used by many users, and from time to
time the database gets corrupted. I do 
> 
> not know what way. I have never such a corrupt on my desktop (I use my app as a user
as well). I can maybe suppose that users 
> 
> are doing something wrong, or the other way that I do.
> Anyway, after db files are corrupted, the data is lost. I don't know how to get them
back. Are there any diagnostic tools for 
> 
> Derby? I don't see any.
> Well this is sample fragment from stacktrace from JDBC trying to open corrupted db:
> 
> (...)
> Page Page(3,Container(0, 976)) is at version 755, the log file contains change version
5 564, either there are log records of 
> 
> this page missing, or this page did not get written out to disk properly.
> ERROR XSDB4: Page Page(3,Container(0, 976)) is at 
> 
> version 755, the log file contains change version 5 564, either there are log records
of this page missing, or this page did 
> 
> not get written out to disk properly.
> 	at org.apache.derby.iapi.error.StandardException.newException(Unknown Source)
> 	at org.apache.derby.impl.store.raw.data.PageBasicOperation.needsRedo(Unknown Source)
> 	at org.apache.derby.impl.store.raw.log.FileLogger.redo(Unknown Source)
> 	at org.apache.derby.impl.store.raw.log.LogToFile.recover(Unknown Source)
> 	at org.apache.derby.impl.store.raw.RawStore.boot(Unknown Source)
> 	at org.apache.derby.impl.services.monitor.BaseMonitor.boot(Unknown Source)
> 	at org.apache.derby.impl.services.monitor.TopService.bootModule(Unknown Source)
> 	at org.apache.derby.impl.services.monitor.BaseMonitor.startModule(Unknown Source)
> 	at org.apache.derby.iapi.services.monitor.Monitor.bootServiceModule(Unknown Source)
> 	at org.apache.derby.impl.store.access.RAMAccessManager.boot(Unknown Source)
> 	at org.apache.derby.impl.services.monitor.BaseMonitor.boot(Unknown Source)
> 	at org.apache.derby.impl.services.monitor.TopService.bootModule(Unknown Source)
> 	at org.apache.derby.impl.services.monitor.BaseMonitor.startModule(Unknown Source)
> 	at org.apache.derby.iapi.services.monitor.Monitor.bootServiceModule(Unknown Source)
> 	at org.apache.derby.impl.db.BasicDatabase.bootStore(Unknown Source)
> 	at org.apache.derby.impl.db.BasicDatabase.boot(Unknown Source)
> 	at org.apache.derby.impl.services.monitor.BaseMonitor.boot(Unknown Source)
> 	at org.apache.derby.impl.services.monitor.TopService.bootModule(Unknown Source)
> 	at org.apache.derby.impl.services.monitor.BaseMonitor.bootService(Unknown Source)
> 	at org.apache.derby.impl.services.monitor.BaseMonitor.startProviderService(Unknown Source)
> 	at org.apache.derby.impl.services.monitor.BaseMonitor.findProviderAndStartService(Unknown
Source)
> 	at org.apache.derby.impl.services.monitor.BaseMonitor.startPersistentService(Unknown
Source)
> 	at org.apache.derby.impl.services.monitor.BaseMonitor.startPersistentService(Unknown
Source)
> 	at org.apache.derby.iapi.services.monitor.Monitor.startPersistentService(Unknown Source)
> 	at org.apache.derby.impl.jdbc.EmbedConnection.bootDatabase(Unknown Source)
> 	at org.apache.derby.impl.jdbc.EmbedConnection.<init>(Unknown Source)
> 	at org.apache.derby.impl.jdbc.EmbedConnection30.<init>(Unknown Source)
> 	at org.apache.derby.jdbc.Driver30.getNewEmbedConnection(Unknown Source)
> 	at org.apache.derby.jdbc.InternalDriver.connect(Unknown Source)
> 	at java.sql.DriverManager.getConnection(Unknown Source)
> 	at java.sql.DriverManager.getConnection(Unknown Source)
> (...)
> 
> Now I have the questions:
> 1. How can I diagnose the bug? Do you have any idea what way can I reproduce it or something?
> 2. Is it possible to restore lost data from such corrupted file?
> 3. Is there possibility that db gets corrupted for example where app is closed wrong
way (for example there is power off) - 
> 
> it should not I suppose?
> 4. Are there any tools that could help me to look at the problem closely?
> 
> Thanks.
> 
> Maciek
> 
> 
> -------------------------------------------------------------------
> Fotoerotica! >>> http://link.interia.pl/f1904
> 
> 

Mime
View raw message