db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Anuradha Weeraman" <aweera...@gmail.com>
Subject Issue with Derby Views
Date Fri, 08 Dec 2006 20:51:29 GMT
Hi All,

The following problem essentially has to do with accessing a view made
up of more than 300 tables. We found out that by reducing the number
of tables in the view, we managed to eliminate the problem. But when
we exceed approximately 300 tables per view, the issue started to
surface.

Below is the link to the discussion that has already taken on this subject:

http://www.nabble.com/Can't-the-embedded-mode-of-a-Derby-database-boot-from-a-dual-JVMs-t2586621.html

Suraj (the reporter of the problem) has created a small application
which you can download from
http://www.nabble.com/file/4227/DerbyIssue.zip that recreates this
issue.

When I debugged the problem, I managed to reproduce the error with the
following exception:

ERROR XSDG3: Meta-data for Container
org.apache.derby.impl.store.raw.data.RAFContainer@397fece1 could not
be accessed

The full stack trace is attached. The root exception seems to be:

java.io.FileNotFoundException:
C:\db\SampleDerbyDatabase\seg0\cd630.dat (Cannot create a file when
that file already exists)

When I debugged into RAFContainer.java, it seems to be throwing the
FILE_CONTAINER_EXCEPTION on line 1539. To give you some context:

--snip--

                 if (stub.exists())
                 {
                     try
                     {
                         boolean delete_status = privRemoveFile(file);
                         if (SanityManager.DEBUG)
                         {
                             if (!delete_status)
                             {
                                 SanityManager.THROWASSERT(
                                     "delete of file (" + file + ") failed.");
                             }
                         }

                         fileData =
                             stub.getRandomAccessFile(canUpdate ? "rw" : "r");

                         readHeader(fileData);
                     }
                     catch (IOException ioe2)
                     {
// *************** LINE 1539: THIS EXCEPTION IS THROWN ***************
                         throw dataFactory.
                             markCorrupt(StandardException.
                                         newException(SQLState.
                                                      FILE_CONTAINER_EXCEPTION,
                                                      ioe2, this));
                     }

                     // RESOLVE: this is a temporary hack

--snip--

I don't know enough of the Derby internals to know why it's doing
that. Would appreciate if someone could shed some light on this.

There are about 3400 files in seg0 folder and there was initial
speculation whether Derby was hitting the following JVM bug:

http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4189011

The JVM bug seems to be specific to Windows, but we managed to
recreate the issue on a Linux JVM, so I'm thinking that the issue is
not related to the JVM and is somehow Derby-related. But then, it ran
successfully on JVM 1.5.0_09, so I might be wrong.

-- 
Anuradha Weeraman
http://www.linux.lk/~anu/
http://anuradha.wordpress.com

Mime
View raw message