db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Bryan Pendleton (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (DERBY-4443) Wrap rollback in exception handlers in try-catch
Date Sun, 27 Mar 2011 00:23:06 GMT

    [ https://issues.apache.org/jira/browse/DERBY-4443?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13011707#comment-13011707
] 

Bryan Pendleton commented on DERBY-4443:
----------------------------------------

When I run the new test as part of the complete JUnit suite, I see the following exception
in my output:


..........java.sql.SQLException: Derby system shutdown.
        at org.apache.derby.impl.jdbc.SQLExceptionFactory40.getSQLException(SQLExceptionFactory40.java:98)
        at org.apache.derby.impl.jdbc.Util.newEmbedSQLException(Util.java:142)
        at org.apache.derby.impl.jdbc.Util.newEmbedSQLException(Util.java:158)
        at org.apache.derby.impl.jdbc.Util.generateCsSQLException(Util.java:222)
        at org.apache.derby.jdbc.InternalDriver.connect(InternalDriver.java:243)
        at org.apache.derbyTesting.functionTests.tests.tools.RollBackWrappingWhenFailOnImportTest$MockInternalDriver.connect(RollBackWrappingWhenFailOnImportTest.java:63)
        at org.apache.derby.jdbc.AutoloadedDriver.connect(AutoloadedDriver.java:144)
        at java.sql.DriverManager.getConnection(DriverManager.java:582)
        at java.sql.DriverManager.getConnection(DriverManager.java:154)
        at org.apache.derbyTesting.junit.DriverManagerConnector.getConnectionByAttributes(DriverManagerConnector.java:143)
        at org.apache.derbyTesting.junit.DriverManagerConnector.shutEngine(DriverManagerConnector.java:120)
        at org.apache.derbyTesting.junit.TestConfiguration.shutdownEngine(TestConfiguration.java:1635)
        at org.apache.derbyTesting.functionTests.tests.engine.ErrorStreamTest.setUp(ErrorStreamTest.java:101)
        at junit.framework.TestCase.runBare(TestCase.java:125)
        at org.apache.derbyTesting.junit.BaseTestCase.runBare(BaseTestCase.java:112)
        at junit.framework.TestResult$1.protect(TestResult.java:106)
        at junit.framework.TestResult.runProtected(TestResult.java:124)
        at junit.framework.TestResult.run(TestResult.java:109)
        at junit.framework.TestCase.run(TestCase.java:118)
        at junit.framework.TestSuite.runTest(TestSuite.java:208)
        at junit.framework.TestSuite.run(TestSuite.java:203)
        at junit.framework.TestSuite.runTest(TestSuite.java:208)
        at junit.framework.TestSuite.run(TestSuite.java:203)
        at junit.framework.TestSuite.runTest(TestSuite.java:208)
        at junit.framework.TestSuite.run(TestSuite.java:203)
        at junit.framework.TestSuite.runTest(TestSuite.java:208)
        at junit.framework.TestSuite.run(TestSuite.java:203)
        at junit.textui.TestRunner.doRun(TestRunner.java:116)
        at junit.textui.TestRunner.start(TestRunner.java:172)
        at junit.textui.TestRunner.main(TestRunner.java:138)
Caused by: java.sql.SQLException: Derby system shutdown.
        at org.apache.derby.impl.jdbc.SQLExceptionFactory.getSQLException(SQLExceptionFactory.java:45)
        at org.apache.derby.impl.jdbc.SQLExceptionFactory40.wrapArgsForTransportAcrossDRDA(SQLExceptionFactory40.java:122)
        at org.apache.derby.impl.jdbc.SQLExceptionFactory40.getSQLException(SQLExceptionFactory40.java:71)
        ... 29 more
E...............................

I think that possibly the test needs to be run with a configuration that says it should only
be
run when we are using the embedded driver, not in the network server configuration?


> 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
>              Labels: derby_triage10_8
>         Attachments: DERBY-4443-1.patch, DERBY-4443-2.patch, DERBY-4443-3.patch, DERBY-4443-4.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

Mime
View raw message