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 505f7493 Comments
505f7493 is described below
commit 505f749373dedb2ee0cee2d9e6a088744b443a4f
Author: Gary Gregory <[email protected]>
AuthorDate: Thu Feb 29 13:49:21 2024 -0500
Comments
Whitespace
---
.../org/apache/commons/dbcp2/managed/BasicManagedDataSource.java | 2 +-
.../commons/dbcp2/managed/DataSourceXAConnectionFactory.java | 7 +------
.../org/apache/commons/dbcp2/managed/LocalXAConnectionFactory.java | 2 +-
3 files changed, 3 insertions(+), 8 deletions(-)
diff --git
a/src/main/java/org/apache/commons/dbcp2/managed/BasicManagedDataSource.java
b/src/main/java/org/apache/commons/dbcp2/managed/BasicManagedDataSource.java
index 2f7d901c..52570bea 100644
--- a/src/main/java/org/apache/commons/dbcp2/managed/BasicManagedDataSource.java
+++ b/src/main/java/org/apache/commons/dbcp2/managed/BasicManagedDataSource.java
@@ -72,7 +72,7 @@ public class BasicManagedDataSource extends BasicDataSource {
throw new SQLException("Transaction manager must be set before a
connection can be created");
}
- // If xa data source is not specified a DriverConnectionFactory is
created and wrapped with a
+ // If XA data source is not specified a DriverConnectionFactory is
created and wrapped with a
// LocalXAConnectionFactory
if (xaDataSource == null) {
final ConnectionFactory connectionFactory =
super.createConnectionFactory();
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 c3d293a3..17b6b6b4 100644
---
a/src/main/java/org/apache/commons/dbcp2/managed/DataSourceXAConnectionFactory.java
+++
b/src/main/java/org/apache/commons/dbcp2/managed/DataSourceXAConnectionFactory.java
@@ -114,9 +114,7 @@ public class DataSourceXAConnectionFactory implements
XAConnectionFactory {
final String userName, final char[] userPassword, final
TransactionSynchronizationRegistry transactionSynchronizationRegistry) {
Objects.requireNonNull(transactionManager, "transactionManager");
Objects.requireNonNull(xaDataSource, "xaDataSource");
-
// We do allow the transactionSynchronizationRegistry to be null for
non-app server environments
-
this.transactionRegistry = new TransactionRegistry(transactionManager,
transactionSynchronizationRegistry);
this.xaDataSource = xaDataSource;
this.userName = userName;
@@ -165,14 +163,11 @@ public class DataSourceXAConnectionFactory implements
XAConnectionFactory {
} else {
xaConnection = xaDataSource.getXAConnection(userName,
Utils.toString(userPassword));
}
-
// get the real connection and XAResource from the connection
final Connection connection = xaConnection.getConnection();
final XAResource xaResource = xaConnection.getXAResource();
-
- // register the xa resource for the connection
+ // register the XA resource for the connection
transactionRegistry.registerConnection(connection, xaResource);
-
// The Connection we're returning is a handle on the XAConnection.
// When the pool calling us closes the Connection, we need to
// also close the XAConnection that holds the physical connection.
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 8d4e2c87..dbcec228 100644
---
a/src/main/java/org/apache/commons/dbcp2/managed/LocalXAConnectionFactory.java
+++
b/src/main/java/org/apache/commons/dbcp2/managed/LocalXAConnectionFactory.java
@@ -361,7 +361,7 @@ public class LocalXAConnectionFactory implements
XAConnectionFactory {
// create a XAResource to manage the connection during XA transactions
final XAResource xaResource = new LocalXAResource(connection);
- // register the xa resource for the connection
+ // register the XA resource for the connection
transactionRegistry.registerConnection(connection, xaResource);
return connection;