Return-Path: Delivered-To: apmail-db-derby-user-archive@www.apache.org Received: (qmail 63342 invoked from network); 25 Apr 2006 15:06:01 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 25 Apr 2006 15:06:00 -0000 Received: (qmail 89507 invoked by uid 500); 25 Apr 2006 15:05:35 -0000 Delivered-To: apmail-db-derby-user-archive@db.apache.org Received: (qmail 89358 invoked by uid 500); 25 Apr 2006 15:05:34 -0000 Mailing-List: contact derby-user-help@db.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: List-Id: Reply-To: "Derby Discussion" Delivered-To: mailing list derby-user@db.apache.org Received: (qmail 89283 invoked by uid 99); 25 Apr 2006 15:05:34 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 25 Apr 2006 08:05:34 -0700 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: local policy) Received: from [129.171.201.11] (HELO diamond.itqa.miami.edu) (129.171.201.11) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 25 Apr 2006 08:05:32 -0700 Received: from JUDGMENTDAY (adsl-068-157-108-010.sip.mia.bellsouth.net [68.157.108.10]) by diamond.itqa.miami.edu (Sun Internet Mail Server sims.4.0.1999.06.13.00.20) with ESMTP id <0IYA006AZAJK05@diamond.itqa.miami.edu> for derby-user@db.apache.org; Tue, 25 Apr 2006 11:19:00 -0400 (EDT) Date: Tue, 25 Apr 2006 11:04:58 -0400 From: "Thomas J. Taylor" Subject: RE: ERROR 25502: An SQL data change is not permitted for a read-only connection To: 'Derby Discussion' Message-id: <003b01c66879$9e709e30$3c00000a@itsdev.infotechsoft.com> MIME-version: 1.0 X-MIMEOLE: Produced By Microsoft MimeOLE V6.00.2900.2869 X-Mailer: Microsoft Office Outlook 11 Content-type: text/plain; charset=iso-8859-1 Content-transfer-encoding: quoted-printable Thread-Index: AcZoeZ2XRs5Ua/1EQg+rxQBGuhRmdw== X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Hello everyone, I'm having a bit of trouble with a Derby 10.1.1.0 database. My ultimate question is how do I recover from ERROR XSDB4 - I have been searching through the manuals and have yet to find information about crash = recovery.=20 Any help is appreciated. Thomas And now, the details... Previously, I reported getting ERROR 25502 (cannot change read-only = data) through a JDBC connection. This computer has three Derby 10.1.1.0 = databases (MyDB-1, MyDB-2, MyDB-3). I would receive ERROR 25502 when accessing = MyDB-1 or MyDB-2 through JDBC. The ERROR 25502 would crash the system before getting to MyDB-3. After further testing on the computer with IJ, I am able to READ, = CREATE, INSERT, UPDATE, and DROP data from MyDB-1 and MyDB-2, but when I try to access MyDB-3 through IJ, I now get ERROR XJ040 "Failed to start = database C:\db\MyDB-3" (see IJ TEST below). ----- START IJ TEST ----- C:\Program Files\Java\jre1.5.0_04\bin\java -classpath derby-10.1.1.0.jar;derbytools-10.1.1.0.jar -Dij.protocol=3Djdbc:derby: -Dij.database=3DC:\DB\MyDB-3 = -Dij.driver=3Dorg.apache.derby.jdbc.EmbeddedDriver org.apache.derby.tools.ij Read_Test.sql SELECT * FROM MyTable; ERROR XJ040: Failed to start database 'C:\DB\MyDB-3', see the next = exception for details. ERROR XSDB4: Page Page(2,Container(0, 3392)) is at version 906, the log = file contains change version 1,325, either there are log records of this page missing, or this page did not get written out to disk properly. ----- END IJ TEST ----- Between the JDBC ERROR 25502 problem and the IJ ERROR XJ040 problem, I = had the computer administrator delete DB.LCK from MyDB-1, MyDB-2, and = MyDB-3; and confirm that Windows WRITE access was allowed on all databases. Thomas J. Taylor wrote: >Hi There, > >I have a Derby database that is giving me a read-only error (25502), = and I >don't know why. The database was working fine, up until about a month = ago. >Now, I cannot INSERT, UPDATE, or DELETE from the database - I always = get >ERROR 25502. I checked Windows Security permissions (user has Full = Control: >READ/MODIFY/WRITE/etc.), File attributes (all files in the database >directory are writable); finally, I deleted the 'db.lck' file that is = in the >database directory. > >There are multiple users accessing this database (different Windows >accounts) - each account gets the same error. It may be that the = database >was shutdown improperly the last time it was running, I don't know. > =20 > ---- SNIP --- >Thomas > >P.S. I receive this error when I run IJ and when I use a connection = through >Java. > > > Driver: org.apache.derby.jdbc.EmbeddedDriver > Version: 10.1.1.0 >JDBC URL: jdbc:derby:../db/MyDB > O/S: Windows XP TPC Edition, SP2 > >ERROR 25502: An SQL data change is not permitted for a read-only connection, >user or database. > at >org.apache.derby.iapi.error.StandardException.newException(Unknown = Source) > at >org.apache.derby.impl.sql.conn.GenericAuthorizer.authorize(Unknown = Source) > at >org.apache.derby.impl.sql.execute.GenericResultSetFactory.getDeleteResul= tSe t >(Unknown Source) > at >org.apache.derby.exe.ac80220011x010axae9bx8591x0000000e94181.fillResultS= et( U >nknown Source) > at >org.apache.derby.exe.ac80220011x010axae9bx8591x0000000e94181.execute(Unk= now n >Source) > at org.apache.derby.impl.sql.GenericActivationHolder.execute(Unknown >Source) > at >org.apache.derby.impl.sql.GenericPreparedStatement.execute(Unknown = Source) > at >org.apache.derby.impl.jdbc.EmbedStatement.executeStatement(Unknown = Source) > at org.apache.derby.impl.jdbc.EmbedStatement.execute(Unknown Source) > at org.apache.derby.impl.jdbc.EmbedStatement.executeUpdate(Unknown >Source) > ... --- SNIP --- Hi Thomas - As =D8ystein stated this problem happens when there is a problem during=20 the startup / booting of the database. In other cases where the problem = did not just 'go away' the cause has been traced to file related issues=20 like permissions, invalid database files (non-Derby files or directories = with a Derby system filename), file descriptor limitations, use of=20 non-hard-disk storage (flash drives, etc), other processes (e.g.=20 backups) locking the files and issues like these. In addition to using a recent build to see if the additional logging=20 provides a clue you can rebuild the database from scratch in a fresh=20 environment without any resource restrictions set and using the local=20 hard disk. Do this from an administrator account and see if the problem = occurs in this copy. If it does not happen then re-examine the existing = system to see how it differs and try eliminating the differences. It=20 might help to reset the existing system including rebooting the machine=20 then remove the db.lck and derby.log files (if they exist) and try=20 accessing the database using IJ from an administrator account. Hope this helps - as you can see this symptom can occur from any number=20 of reasons and I sure we have not identified them all yet.