Return-Path: X-Original-To: apmail-db-derby-dev-archive@www.apache.org Delivered-To: apmail-db-derby-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id C32D274BF for ; Mon, 24 Oct 2011 12:19:52 +0000 (UTC) Received: (qmail 61168 invoked by uid 500); 24 Oct 2011 12:19:52 -0000 Delivered-To: apmail-db-derby-dev-archive@db.apache.org Received: (qmail 61143 invoked by uid 500); 24 Oct 2011 12:19:52 -0000 Mailing-List: contact derby-dev-help@db.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: Delivered-To: mailing list derby-dev@db.apache.org Received: (qmail 61136 invoked by uid 99); 24 Oct 2011 12:19:52 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 24 Oct 2011 12:19:52 +0000 X-ASF-Spam-Status: No, hits=-2000.5 required=5.0 tests=ALL_TRUSTED,RP_MATCHES_RCVD X-Spam-Check-By: apache.org Received: from [140.211.11.116] (HELO hel.zones.apache.org) (140.211.11.116) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 24 Oct 2011 12:19:51 +0000 Received: from hel.zones.apache.org (hel.zones.apache.org [140.211.11.116]) by hel.zones.apache.org (Postfix) with ESMTP id 13A0D319C4E for ; Mon, 24 Oct 2011 12:17:32 +0000 (UTC) Date: Mon, 24 Oct 2011 12:17:32 +0000 (UTC) From: "Kristian Waagan (Resolved) (JIRA)" To: derby-dev@db.apache.org Message-ID: <184869088.8349.1319458652082.JavaMail.tomcat@hel.zones.apache.org> In-Reply-To: <1564889476.13962.1308282647403.JavaMail.tomcat@hel.zones.apache.org> Subject: [jira] [Resolved] (DERBY-5283) Crash / process termination during SYSCS_DISABLE_LOG_ARCHIVE_MODE can leave service.properties broken MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/DERBY-5283?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Kristian Waagan resolved DERBY-5283. ------------------------------------ Resolution: Fixed Fix Version/s: 10.9.0.0 Issue & fix info: (was: Patch Available) Committed patch 1c to trunk with revision 1188109. > Crash / process termination during SYSCS_DISABLE_LOG_ARCHIVE_MODE can leave service.properties broken > ----------------------------------------------------------------------------------------------------- > > Key: DERBY-5283 > URL: https://issues.apache.org/jira/browse/DERBY-5283 > Project: Derby > Issue Type: Bug > Components: Miscellaneous > Affects Versions: 10.6.1.0, 10.8.1.2 > Environment: >sysinfo > ------------------ Java Information ------------------ > Java Version: 1.6.0_26 > Java Vendor: Sun Microsystems Inc. > Java home: C:\Program Files (x86)\Java\jre6 > Java classpath: .;C:\Program Files (x86)\Java\jre6\lib\ext\QTJava.zip;C:\Users\BMASON\Sandbox\libs\db-derby-10.6.1.0-bin\bin\../lib/derby.jar;C:\Users\BMASON\Sandbox\libs\db-derby-10.6.1.0-bin\bin\../lib/derbynet.jar;C:\Users\BMASON\Sandbox\libs\db-derby-10.6.1.0-bin\bin\../lib/derbyclient.jar;C:\Users\BMASON\Sandbox\libs\db-derby-10.6.1.0-bin\bin\../lib/derbytools.jar > OS name: Windows 7 > OS architecture: x86 > OS version: 6.1 > Java user name: bmason > Java user home: C:\Users\BMASON > Java user dir: C:\Users\BMASON\Sandbox\libs\db-derby-10.6.1.0-bin\bin > java.specification.name: Java Platform API Specification > java.specification.version: 1.6 > java.runtime.version: 1.6.0_26-b03 > --------- Derby Information -------- > JRE - JDBC: Java SE 6 - JDBC 4.0 > [C:\Users\BMASON\Sandbox\libs\db-derby-10.6.1.0-bin\lib\derby.jar] 10.6.1.0 - (938214) > [C:\Users\BMASON\Sandbox\libs\db-derby-10.6.1.0-bin\lib\derbytools.jar] 10.6.1.0 - (938214) > [C:\Users\BMASON\Sandbox\libs\db-derby-10.6.1.0-bin\lib\derbynet.jar] 10.6.1.0 - (938214) > [C:\Users\BMASON\Sandbox\libs\db-derby-10.6.1.0-bin\lib\derbyclient.jar] 10.6.1.0 - (938214) > ------------------------------------------------------ > ----------------- Locale Information ----------------- > Current Locale : [English/New Zealand [en_NZ]] > Found support for locale: [cs] > version: 10.6.1.0 - (938214) > Found support for locale: [de_DE] > version: 10.6.1.0 - (938214) > Found support for locale: [es] > version: 10.6.1.0 - (938214) > Found support for locale: [fr] > version: 10.6.1.0 - (938214) > Found support for locale: [hu] > version: 10.6.1.0 - (938214) > Found support for locale: [it] > version: 10.6.1.0 - (938214) > Found support for locale: [ja_JP] > version: 10.6.1.0 - (938214) > Found support for locale: [ko_KR] > version: 10.6.1.0 - (938214) > Found support for locale: [pl] > version: 10.6.1.0 - (938214) > Found support for locale: [pt_BR] > version: 10.6.1.0 - (938214) > Found support for locale: [ru] > version: 10.6.1.0 - (938214) > Found support for locale: [zh_CN] > version: 10.6.1.0 - (938214) > Found support for locale: [zh_TW] > version: 10.6.1.0 - (938214) > ------------------------------------------------------ > Reporter: Brett Mason > Assignee: Kristian Waagan > Fix For: 10.9.0.0 > > Attachments: derby-5283-1a-recover.diff, derby-5283-1b-recover.diff, derby-5283-1c-recover.diff > > > If Derby is terminated while SYSCS_DISABLE_LOG_ARCHIVE_MODE is being called service.properties can be left in a broken state. > Depending on timing either of the two cases can happen: > Case 1: > "ERROR XBM0S: Unable to rename file 'C:\PATH_TO_DB\service.properties' to 'C:\PATH_TO_DB\service.propertiesold' " is thrown when next trying to call > SYSCS_DISABLE_LOG_ARCHIVE_MODE(1). Both "service.properties" and "service.propertiesold" are present in the database directory. Removing "service.propertiesold" corrects the problem. > Case 2: > "SQLException: Database 'C:\PATH_TO_DB' not found" is thrown when booting the database. The file service.properties does not exist in the database directory but service.propertiesold does exist. Renaming the file back to "service.properties" corrects the problem. > As mentioned above both cases have workarounds but they require manual intervention which is a problem for applications installed to a customer site. It would be great if a more reliable method to update the file could be found. > The following sample code will reproduce the issue fairly reliably by terminating the java process: > import java.sql.*; > import org.apache.derby.jdbc.*; > public class DerbyLogArchiveModeTest { > > public static void main(String[] args) { > final EmbeddedDataSource ds = new EmbeddedDataSource(); > ds.setDatabaseName("derbyTest"); > ds.setCreateDatabase("create"); > try { > final Connection conn = ds.getConnection(); > try { > final Statement stmt = conn.createStatement(); > try { > while (true) { > stmt.execute("call SYSCS_UTIL.SYSCS_DISABLE_LOG_ARCHIVE_MODE(1)"); > } > } finally { > stmt.close(); > } > } finally { > conn.close(); > } > } catch (SQLException e) { > e.printStackTrace(); > } > } > } -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa For more information on JIRA, see: http://www.atlassian.com/software/jira