From 47485f2ff341d84217bf7c160f030c6685e5ef3f Mon Sep 17 00:00:00 2001 From: Jesse Morgan Date: Mon, 2 Mar 2015 16:13:03 -0800 Subject: Updating POM to deploy v1.2.4 to Maven. --- RELEASING.md | 46 +++++++++++++++++++++++++++++++++ pom.xml | 83 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++- 2 files changed, 128 insertions(+), 1 deletion(-) create mode 100644 RELEASING.md diff --git a/RELEASING.md b/RELEASING.md new file mode 100644 index 0000000..db0c504 --- /dev/null +++ b/RELEASING.md @@ -0,0 +1,46 @@ +RELEASING +========= + +This file outlines how to publish a new release to Maven Central. + +Prerequisites +------------- + +* You will need the Carbonado GPG key and passphrase to continue. Contact + @jesterpm or @broneill to obtain them. + +* You will need an account with Sonatype Nexus. You can create that + [here](https://issues.sonatype.org/secure/Signup!default.jspa). Contact + @jesterpm or @broneill for access to the Cojen repository. + +Process +------- + +1. Increment the version number appropriately. + Use [Semantic Versioning](http://semver.org/). + + VERSION=1.2.4 + mvn versions:set -DnewVersion=$VERSION + +2. Verify the release and make sure all is well. + + mvn clean verify -P release + +3. Commit and tag the latest release. + + git commit -am "Release $VERSION" + git tag -a v$VERSION -m "Release $VERSION" + +4. Deploy to Sonatype: + + mvn clean deploy -P release + +5. Push commit and tag to GitHub + + git push origin master + git push origin v$VERSION + +6. Create a new Releases on GitHub. Use the tag you just created and optionally + include a change log. Attach the compiled, sources, and javadoc jar files, + along with the .asc signature files. + diff --git a/pom.xml b/pom.xml index 71a8a0f..24ada43 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ carbonado jar Carbonado - 1.2.3 + 1.2.4 Extensible, high performance persistence abstraction layer for Java applications with a relational view to the underlying persistence technology. @@ -195,11 +195,37 @@ org.apache.maven.plugins maven-compiler-plugin + 3.0 1.5 1.5 + + + org.apache.maven.plugins + maven-javadoc-plugin + 2.9.1 + + 1.7 + false + + http://docs.oracle.com/javase/7/docs/api + + true + + + + attach-javadocs + + jar + + + -Xdoclint:none + + + + @@ -276,4 +302,59 @@ + + + + release + + + + + org.apache.maven.plugins + maven-source-plugin + 2.2.1 + + + attach-sources + + jar-no-fork + + + + + + + org.apache.maven.plugins + maven-gpg-plugin + 1.5 + + + sign-artifacts + verify + + sign + + + 2753E2C6 + + + + + + + org.sonatype.plugins + nexus-staging-maven-plugin + 1.6.3 + true + + ossrh + https://oss.sonatype.org/ + true + + + + + + + -- cgit v1.2.3 From f84d8732fc2ee009e6babcb31e7a9428b3e1b285 Mon Sep 17 00:00:00 2001 From: Jesse Morgan Date: Tue, 3 Mar 2015 11:28:11 -0800 Subject: Correcting typo in RELEASING.md --- RELEASING.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/RELEASING.md b/RELEASING.md index db0c504..a7ddd36 100644 --- a/RELEASING.md +++ b/RELEASING.md @@ -7,11 +7,11 @@ Prerequisites ------------- * You will need the Carbonado GPG key and passphrase to continue. Contact - @jesterpm or @broneill to obtain them. + @jesterpm or @pranaydalmia to obtain them. * You will need an account with Sonatype Nexus. You can create that [here](https://issues.sonatype.org/secure/Signup!default.jspa). Contact - @jesterpm or @broneill for access to the Cojen repository. + @jesterpm or @pranaydalmia for access to the Carbonado repository. Process ------- -- cgit v1.2.3 From 714003911f00d63be0d2ab23a6028005150f9840 Mon Sep 17 00:00:00 2001 From: Jesse Morgan Date: Thu, 5 Mar 2015 15:09:26 -0800 Subject: Fixing leaked JDBC Connections. Fixing a leak if aborting a transaction throws an exception (e.g. request made on closed connection). --- .../carbonado/repo/jdbc/JDBCTransaction.java | 15 +++++++---- .../repo/jdbc/JDBCTransactionManager.java | 30 +++++++++++++++------- 2 files changed, 31 insertions(+), 14 deletions(-) diff --git a/src/main/java/com/amazon/carbonado/repo/jdbc/JDBCTransaction.java b/src/main/java/com/amazon/carbonado/repo/jdbc/JDBCTransaction.java index ffa2e5c..00e6947 100644 --- a/src/main/java/com/amazon/carbonado/repo/jdbc/JDBCTransaction.java +++ b/src/main/java/com/amazon/carbonado/repo/jdbc/JDBCTransaction.java @@ -106,10 +106,17 @@ class JDBCTransaction { } /** - * @return connection to close, or null if not ready to because this was a - * nested transaction + * @return true if the connection should be closed after the transaction is aborted. */ - Connection abort() throws SQLException { + boolean shouldCloseConnection() { + return !mIsNested; + } + + /** + * Note: The caller should close the connection after aborting if + * shouldCloseConnection() returns true. + */ + void abort() throws SQLException { if (mRegisteredLobs != null) { for (JDBCLob lob : mRegisteredLobs) { lob.close(); @@ -134,13 +141,11 @@ class JDBCTransaction { } } - return null; } else { if (mReady) { mConnection.rollback(); mReady = false; } - return mConnection; } } diff --git a/src/main/java/com/amazon/carbonado/repo/jdbc/JDBCTransactionManager.java b/src/main/java/com/amazon/carbonado/repo/jdbc/JDBCTransactionManager.java index c649058..9fe2ff4 100644 --- a/src/main/java/com/amazon/carbonado/repo/jdbc/JDBCTransactionManager.java +++ b/src/main/java/com/amazon/carbonado/repo/jdbc/JDBCTransactionManager.java @@ -97,18 +97,30 @@ class JDBCTransactionManager extends TransactionManager { @Override protected void abortTxn(JDBCTransaction txn) throws PersistException { + PersistException ex = null; + try { - Connection con; - if ((con = txn.abort()) != null) { - JDBCRepository repo = mRepositoryRef.get(); - if (repo == null) { - con.close(); - } else { - repo.closeConnection(con); + txn.abort(); + } catch (Throwable e) { + ex = mExTransformer.toPersistException(e); + throw ex; + } finally { + try { + if (txn.shouldCloseConnection()) { + Connection con = txn.getConnection(); + JDBCRepository repo = mRepositoryRef.get(); + if (repo == null) { + con.close(); + } else { + repo.closeConnection(con); + } + } + } catch (Throwable e) { + // Don't lose the original exception. + if (ex == null) { + throw mExTransformer.toPersistException(e); } } - } catch (Throwable e) { - throw mExTransformer.toPersistException(e); } } } -- cgit v1.2.3