Return-Path: Delivered-To: apmail-db-derby-dev-archive@www.apache.org Received: (qmail 34982 invoked from network); 29 Mar 2011 15:13:47 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 29 Mar 2011 15:13:47 -0000 Received: (qmail 43809 invoked by uid 500); 29 Mar 2011 15:13:47 -0000 Delivered-To: apmail-db-derby-dev-archive@db.apache.org Received: (qmail 43785 invoked by uid 500); 29 Mar 2011 15:13:47 -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 43778 invoked by uid 99); 29 Mar 2011 15:13:47 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 29 Mar 2011 15:13:47 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED,T_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; Tue, 29 Mar 2011 15:13:46 +0000 Received: from hel.zones.apache.org (hel.zones.apache.org [140.211.11.116]) by hel.zones.apache.org (Postfix) with ESMTP id E2F938638A for ; Tue, 29 Mar 2011 15:13:09 +0000 (UTC) Date: Tue, 29 Mar 2011 15:13:09 +0000 (UTC) From: "Houx Zhang (JIRA)" To: derby-dev@db.apache.org Message-ID: <1522237000.19055.1301411589926.JavaMail.tomcat@hel.zones.apache.org> Subject: [jira] [Updated] (DERBY-4443) Wrap rollback in exception handlers in try-catch 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-4443?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Houx Zhang updated DERBY-4443: ------------------------------ Attachment: DERBY-4443-5.patch Thanks for your advice, Knut and Bryan. It's valuable for me to make progress. I have recreated the error with Bryan's command. Here is why it's caused: In the new test class 'RollBackWrappingWhenFailOnImportTest', a mock driver has been loaded, but it has not been shut down any more. In setup() method of engine.ErrorStreamTest which is closed in the completed test, a shutdownEngine() is called, it's used to shut down the current engine. The shutdown operation invokes a call to MockInternalDriver.connect(), which throw a mock connection(not valid here), so a SQLException of "Derby system shutdown" is thrown. It's obvious that, 'RollBackWrappingWhenFailOnImportTest' has made a marginal influence on other test cases, so in patch-5, I shut down the mock driver on tearDown(), -----the exception can be ignored safely. Now, everything works well. In patch-5, Knut's advices on printStackTrace() and vmSupportsJDBC3() are adopted. Thanks! Please check the new patch-5! > Wrap rollback in exception handlers in try-catch > ------------------------------------------------ > > Key: DERBY-4443 > URL: https://issues.apache.org/jira/browse/DERBY-4443 > Project: Derby > Issue Type: Bug > Components: Demos/Scripts, Documentation, Eclipse Plug-in, JDBC, Network Client, Network Server, Replication, Services, SQL, Test, Tools > Affects Versions: 10.5.3.0 > Reporter: Aaron Digulla > Assignee: Houx Zhang > Labels: derby_triage10_8 > Attachments: DERBY-4443-1.patch, DERBY-4443-2.patch, DERBY-4443-3.patch, DERBY-4443-4.patch, DERBY-4443-4.png, DERBY-4443-5.patch, DERBY-4443.patch > > > Avoid this pattern everywhere: > }catch(SQLException se){ > //issue a rollback on any errors > conn.rollback(); > throw se; > } > because an error in rollback will shadow the original exception. -- This message is automatically generated by JIRA. For more information on JIRA, see: http://www.atlassian.com/software/jira