You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by gg...@apache.org on 2021/05/31 22:06:33 UTC
[commons-dbcp] branch master updated: Add missing Javadoc.
This is an automated email from the ASF dual-hosted git repository.
ggregory pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-dbcp.git
The following commit(s) were added to refs/heads/master by this push:
new 0658749 Add missing Javadoc.
0658749 is described below
commit 06587495a1cd19e567bd076c8eacb5bac412a811
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Mon May 31 18:06:30 2021 -0400
Add missing Javadoc.
---
.../commons/dbcp2/managed/DataSourceXAConnectionFactory.java | 10 ++++++++++
.../apache/commons/dbcp2/managed/LocalXAConnectionFactory.java | 8 ++++++++
.../org/apache/commons/dbcp2/managed/ManagedConnection.java | 3 +++
3 files changed, 21 insertions(+)
diff --git a/src/main/java/org/apache/commons/dbcp2/managed/DataSourceXAConnectionFactory.java b/src/main/java/org/apache/commons/dbcp2/managed/DataSourceXAConnectionFactory.java
index d432839..07e6f4e 100644
--- a/src/main/java/org/apache/commons/dbcp2/managed/DataSourceXAConnectionFactory.java
+++ b/src/main/java/org/apache/commons/dbcp2/managed/DataSourceXAConnectionFactory.java
@@ -206,10 +206,20 @@ public class DataSourceXAConnectionFactory implements XAConnectionFactory {
return userName;
}
+ /**
+ * Gets the user password.
+ *
+ * @return the user password.
+ */
public char[] getUserPassword() {
return userPassword == null ? null : userPassword.clone();
}
+ /**
+ * Gets the XA data source.
+ *
+ * @return the XA data source.
+ */
public XADataSource getXaDataSource() {
return xaDataSource;
}
diff --git a/src/main/java/org/apache/commons/dbcp2/managed/LocalXAConnectionFactory.java b/src/main/java/org/apache/commons/dbcp2/managed/LocalXAConnectionFactory.java
index 6992ef2..8b15b17 100644
--- a/src/main/java/org/apache/commons/dbcp2/managed/LocalXAConnectionFactory.java
+++ b/src/main/java/org/apache/commons/dbcp2/managed/LocalXAConnectionFactory.java
@@ -36,6 +36,7 @@ import java.util.Objects;
* @since 2.0
*/
public class LocalXAConnectionFactory implements XAConnectionFactory {
+
/**
* LocalXAResource is a fake XAResource for non-XA connections. When a transaction is started the connection
* auto-commit is turned off. When the connection is committed or rolled back, the commit or rollback method is
@@ -44,8 +45,10 @@ public class LocalXAConnectionFactory implements XAConnectionFactory {
* The LocalXAResource also respects the connection read-only setting. If the connection is read-only the commit
* method will not be called, and the prepare method returns the XA_RDONLY.
* </p>
+ * <p>
* It is assumed that the wrapper around a managed connection disables the setAutoCommit(), commit(), rollback() and
* setReadOnly() methods while a transaction is in progress.
+ * </p>
*
* @since 2.0
*/
@@ -55,6 +58,11 @@ public class LocalXAConnectionFactory implements XAConnectionFactory {
private Xid currentXid; // @GuardedBy("this")
private boolean originalAutoCommit; // @GuardedBy("this")
+ /**
+ * Construct a new instance for a given connection.
+ *
+ * @param localTransaction A connection.
+ */
public LocalXAResource(final Connection localTransaction) {
this.connection = localTransaction;
}
diff --git a/src/main/java/org/apache/commons/dbcp2/managed/ManagedConnection.java b/src/main/java/org/apache/commons/dbcp2/managed/ManagedConnection.java
index b1c2adf..e964509 100644
--- a/src/main/java/org/apache/commons/dbcp2/managed/ManagedConnection.java
+++ b/src/main/java/org/apache/commons/dbcp2/managed/ManagedConnection.java
@@ -201,6 +201,9 @@ public class ManagedConnection<C extends Connection> extends DelegatingConnectio
super.setReadOnly(readOnly);
}
+ /**
+ * Completes the transaction.
+ */
protected void transactionComplete() {
lock.lock();
try {