From derby-dev-return-118591-archive-asf-public=cust-asf.ponee.io@db.apache.org Mon Jan 8 01:16:06 2018 Return-Path: X-Original-To: archive-asf-public@eu.ponee.io Delivered-To: archive-asf-public@eu.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by mx-eu-01.ponee.io (Postfix) with ESMTP id C7A93180654 for ; Mon, 8 Jan 2018 01:16:06 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id B0EF1160C3D; Mon, 8 Jan 2018 00:16:06 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id CE49A160C2A for ; Mon, 8 Jan 2018 01:16:05 +0100 (CET) Received: (qmail 74653 invoked by uid 500); 8 Jan 2018 00:16:04 -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 74643 invoked by uid 99); 8 Jan 2018 00:16:04 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd2-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 08 Jan 2018 00:16:04 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd2-us-west.apache.org (ASF Mail Server at spamd2-us-west.apache.org) with ESMTP id 2C8801A043B for ; Mon, 8 Jan 2018 00:16:04 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd2-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -99.911 X-Spam-Level: X-Spam-Status: No, score=-99.911 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, RCVD_IN_DNSWL_LOW=-0.7, SPF_PASS=-0.001, T_RP_MATCHES_RCVD=-0.01, USER_IN_WHITELIST=-100] autolearn=disabled Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd2-us-west.apache.org [10.40.0.9]) (amavisd-new, port 10024) with ESMTP id vXdxS8Bcrv4m for ; Mon, 8 Jan 2018 00:16:02 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTP id 9206E5F24E for ; Mon, 8 Jan 2018 00:16:02 +0000 (UTC) Received: from jira-lw-us.apache.org (unknown [207.244.88.139]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id 26DFBE0F23 for ; Mon, 8 Jan 2018 00:16:01 +0000 (UTC) Received: from jira-lw-us.apache.org (localhost [127.0.0.1]) by jira-lw-us.apache.org (ASF Mail Server at jira-lw-us.apache.org) with ESMTP id 485EC240F2 for ; Mon, 8 Jan 2018 00:16:00 +0000 (UTC) Date: Mon, 8 Jan 2018 00:16:00 +0000 (UTC) From: "Rick Hillegas (JIRA)" To: derby-dev@db.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Updated] (DERBY-6945) Re-package Derby as a collection of jigsaw modules 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-6945?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Rick Hillegas updated DERBY-6945: --------------------------------- Attachment: derby-6945-09-ab-moveInternalDriver.diff Attaching derby-6945-09-ab-moveInternalDriver.diff. As preparation for moving org.apache.derby.jdbc into derbytools.jar, this patch moves the following non-publicAPI classes out of org.apache.derby.jdbc and into org.apache.derby.iapi.jdbc: InternalDriver (the tricky guts of the embedded driver) JDBC (the engine's Version MBean) This also involved some delicate changes to JDBCBoot (the tricky logic which boots the engine) For the moment, I have retreated from a more ambitious effort to also move AutoloadedDriver. That change was causing nested connections to fail. That is, it broke the resolution of connection URLs which start with the special sqlj jdbc:default:connection token. After I commit this patch, I will go back to trying to move AutoloadedDriver. The embedded driver and engine boot logic are spread fragilely across several cooperating classes. When I moved InternalDriver and JDBCBoot, I uncovered another race condition which involves two threads trying to call DriverManager.getConnection() simultaneously. ConcurrentAutoloadTest disclosed this. I have put all of the boot logic inside a synchronized block. That fixed the problem. Moreover, it struck me as a long overdue improvement. It seems to me that we were just asking for trouble by allowing two threads to simultaneously race through the complicated booting of engine components. I am not confident that there aren't other race conditions in this subtle logic. It could use a top-down overhaul. Tests ran cleanly for me on this patch. Touches the following files: ------------------------------------- A + java/engine/org/apache/derby/iapi/jdbc/InternalDriver.java A + java/engine/org/apache/derby/iapi/jdbc/JDBC.java D java/engine/org/apache/derby/jdbc/InternalDriver.java D java/engine/org/apache/derby/jdbc/JDBC.java M java/build/org/apache/derbyBuild/lastgoodjarcontents/insane.derby.jar.lastcontents M java/build/org/apache/derbyBuild/lastgoodjarcontents/sane.derby.jar.lastcontents Move InternalDriver and JDBC out of the public api package and into an engine-internal api package. ------------------------------------- M java/engine/org/apache/derby/jdbc/AutoloadedDriver.java M java/engine/org/apache/derby/jdbc/EmbeddedDriver.java M java/engine/org/apache/derby/iapi/jdbc/JDBCBoot.java Fix a race condition involving two threads which try to get a connection at the same time. ------------------------------------- M java/engine/org/apache/derby/jdbc/BasicEmbeddedConnectionPoolDataSource40.java M java/engine/org/apache/derby/jdbc/BasicEmbeddedDataSource40.java M java/engine/org/apache/derby/jdbc/BasicEmbeddedXADataSource40.java M java/engine/org/apache/derby/jdbc/EmbeddedConnectionPoolDataSource.java M java/engine/org/apache/derby/jdbc/EmbeddedXADataSource.java Pull the creation of Connection objects out of InternalDriver and put it into the DataSources, where it belongs. This fixes InternalDriver so that it does not call up into the public api package. ------------------------------------- M java/drda/org/apache/derby/impl/drda/DRDAConnThread.java M java/engine/org/apache/derby/catalog/SystemProcedures.java M java/engine/org/apache/derby/impl/db/SlaveDatabase.java M java/engine/org/apache/derby/impl/jdbc/ConnectionChild.java M java/engine/org/apache/derby/impl/jdbc/EmbedConnection.java M java/engine/org/apache/derby/impl/jdbc/LOBStoredProcedure.java M java/engine/org/apache/derby/impl/jdbc/TransactionResourceImpl.java M java/engine/org/apache/derby/impl/jdbc/authentication/NativeAuthenticationServiceImpl.java M java/engine/org/apache/derby/jdbc/Driver42.java M java/testing/org/apache/derbyTesting/functionTests/tests/jdbc4/Wrapper41Driver.java M java/testing/org/apache/derbyTesting/functionTests/tests/tools/RollBackWrappingWhenFailOnImportTest.java Adjust import statements to account for the relocation of InternalDriver. ------------------------------------- M java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/ConcurrentAutoloadTest.java Make this test report more failure information. > Re-package Derby as a collection of jigsaw modules > -------------------------------------------------- > > Key: DERBY-6945 > URL: https://issues.apache.org/jira/browse/DERBY-6945 > Project: Derby > Issue Type: Improvement > Affects Versions: 10.13.1.2 > Reporter: Rick Hillegas > Attachments: derby-6945-01-aa-remove_derbyPreBuild_dep.diff, derby-6945-02-ab-newDerbySharedJar.diff, derby-6945-02-ac-newDerbySharedJar.diff, derby-6945-03-aa-partitionTest.diff, derby-6945-04-aa-moveRunClass.diff, derby-6945-05-aa-removeRedundant_Attribute_SQLState.diff, derby-6945-06-aa-removeOtherSharedDuplicates.diff, derby-6945-07-aa-net_client_overlap.diff, derby-6945-08-aa-move_shared_iapi_under_shared.diff, derby-6945-08-ab-move_shared_iapi_under_shared.diff, derby-6945-08-ad-move_shared_iapi_under_shared.diff, derby-6945-09-ab-moveInternalDriver.diff, jdeps.out.tar > > > Once we commit to building with Java 9 (see DERBY-6856), we should consider re-packaging Derby as a set of jigsaw modules. This would result in a different set of release artifacts. This might be a good opportunity to address the Tomcat artifactory issues raised by issue DERBY-6944. -- This message was sent by Atlassian JIRA (v6.4.14#64029)