[jboss-cvs] JBossAS SVN: r114733 - in branches/JBPAPP_5: connector/src/main/org/jboss/resource/adapter/jdbc and 3 other directories.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Mon Feb 17 01:00:47 EST 2014
Author: jameslivingston
Date: 2014-02-17 01:00:46 -0500 (Mon, 17 Feb 2014)
New Revision: 114733
Modified:
branches/JBPAPP_5/build/build.xml
branches/JBPAPP_5/connector/src/main/org/jboss/resource/adapter/jdbc/BaseWrapperManagedConnection.java
branches/JBPAPP_5/connector/src/main/org/jboss/resource/adapter/jdbc/BaseWrapperManagedConnectionFactory.java
branches/JBPAPP_5/connector/src/main/org/jboss/resource/adapter/jdbc/local/LocalManagedConnectionFactory.java
branches/JBPAPP_5/connector/src/main/org/jboss/resource/adapter/jdbc/xa/XAManagedConnectionFactory.java
branches/JBPAPP_5/server/build.xml
Log:
[JBPAPP-10968] remove ManagedConnectionFactory bottleneck added by JBPAPP-7464 fix.
Modified: branches/JBPAPP_5/build/build.xml
===================================================================
--- branches/JBPAPP_5/build/build.xml 2014-02-16 13:11:33 UTC (rev 114732)
+++ branches/JBPAPP_5/build/build.xml 2014-02-17 06:00:46 UTC (rev 114733)
@@ -1390,7 +1390,7 @@
<!-- Define a macro for calling maven -->
<macrodef name="maven">
- <attribute name="options" default="" />
+ <attribute name="options" default="-T4" />
<attribute name="goal" />
<attribute name="basedir" />
<attribute name="resultproperty" default="maven.result" />
@@ -1436,7 +1436,7 @@
<target name="createthirdparty" unless="inhibit.downloads"
depends="maven-init, init, check.inhibit.downloads, set.proxy">
- <property name="maven.opts" value=""/>
+ <property name="maven.opts" value="-T4"/>
<property name="thirdparty.maven.opts" value="${maven.opts}"/>
<maven basedir="${basedir}/../thirdparty"
Modified: branches/JBPAPP_5/connector/src/main/org/jboss/resource/adapter/jdbc/BaseWrapperManagedConnection.java
===================================================================
--- branches/JBPAPP_5/connector/src/main/org/jboss/resource/adapter/jdbc/BaseWrapperManagedConnection.java 2014-02-16 13:11:33 UTC (rev 114732)
+++ branches/JBPAPP_5/connector/src/main/org/jboss/resource/adapter/jdbc/BaseWrapperManagedConnection.java 2014-02-17 06:00:46 UTC (rev 114733)
@@ -570,7 +570,7 @@
private void checkIdentity(Subject subject, ConnectionRequestInfo cri) throws ResourceException
{
- Properties newProps = mcf.getConnectionProperties(subject, cri);
+ Properties newProps = mcf.getConnectionProperties(props, subject, cri);
if (!props.equals(newProps))
{
throw new JBossResourceException("Wrong credentials passed to getConnection!");
Modified: branches/JBPAPP_5/connector/src/main/org/jboss/resource/adapter/jdbc/BaseWrapperManagedConnectionFactory.java
===================================================================
--- branches/JBPAPP_5/connector/src/main/org/jboss/resource/adapter/jdbc/BaseWrapperManagedConnectionFactory.java 2014-02-16 13:11:33 UTC (rev 114732)
+++ branches/JBPAPP_5/connector/src/main/org/jboss/resource/adapter/jdbc/BaseWrapperManagedConnectionFactory.java 2014-02-17 06:00:46 UTC (rev 114733)
@@ -75,11 +75,6 @@
protected String userName;
protected String password;
- //This is used by Local wrapper for all properties, and is left
- //in this class for ease of writing getConnectionProperties,
- //which always holds the user/pw.
- protected final Properties connectionProps = new Properties();
-
protected int transactionIsolation = -1;
protected int preparedStatementCacheSize = 0;
@@ -491,14 +486,17 @@
* <p>In fact, we have a problem here. Theoretically, there is a possible
* name collision between config properties and "user"/"password".
*/
- protected synchronized Properties getConnectionProperties(Subject subject, ConnectionRequestInfo cri)
+ protected synchronized Properties getConnectionProperties(Properties connectionProps, Subject subject, ConnectionRequestInfo cri)
throws ResourceException
{
if (cri != null && cri.getClass() != WrappedConnectionRequestInfo.class)
throw new JBossResourceException("Wrong kind of ConnectionRequestInfo: " + cri.getClass());
Properties props = new Properties();
- props.putAll(connectionProps);
+
+ if (connectionProps != null && connectionProps.size() > 0)
+ props.putAll(connectionProps);
+
if (subject != null)
{
if (SubjectActions.addMatchingProperties(subject, props, this) == true)
Modified: branches/JBPAPP_5/connector/src/main/org/jboss/resource/adapter/jdbc/local/LocalManagedConnectionFactory.java
===================================================================
--- branches/JBPAPP_5/connector/src/main/org/jboss/resource/adapter/jdbc/local/LocalManagedConnectionFactory.java 2014-02-16 13:11:33 UTC (rev 114732)
+++ branches/JBPAPP_5/connector/src/main/org/jboss/resource/adapter/jdbc/local/LocalManagedConnectionFactory.java 2014-02-17 06:00:46 UTC (rev 114733)
@@ -66,6 +66,9 @@
protected String connectionProperties;
+ /** The connection properties */
+ protected final Properties connectionProps = new Properties();
+
public LocalManagedConnectionFactory()
{
@@ -165,10 +168,10 @@
}
}
- public synchronized ManagedConnection createManagedConnection(Subject subject, ConnectionRequestInfo cri)
+ public ManagedConnection createManagedConnection(Subject subject, ConnectionRequestInfo cri)
throws javax.resource.ResourceException
{
- Properties props = getConnectionProperties(subject, cri);
+ Properties props = getConnectionProperties(connectionProps, subject, cri);
// Some friendly drivers (Oracle, you guessed right) modify the props you supply.
// Since we use our copy to identify compatibility in matchManagedConnection, we need
// a pristine copy for our own use. So give the friendly driver a copy.
@@ -385,7 +388,7 @@
public ManagedConnection matchManagedConnections(final Set mcs, final Subject subject,
final ConnectionRequestInfo cri) throws ResourceException
{
- Properties newProps = getConnectionProperties(subject, cri);
+ Properties newProps = getConnectionProperties(connectionProps, subject, cri);
for (Iterator i = mcs.iterator(); i.hasNext();)
{
Modified: branches/JBPAPP_5/connector/src/main/org/jboss/resource/adapter/jdbc/xa/XAManagedConnectionFactory.java
===================================================================
--- branches/JBPAPP_5/connector/src/main/org/jboss/resource/adapter/jdbc/xa/XAManagedConnectionFactory.java 2014-02-16 13:11:33 UTC (rev 114732)
+++ branches/JBPAPP_5/connector/src/main/org/jboss/resource/adapter/jdbc/xa/XAManagedConnectionFactory.java 2014-02-17 06:00:46 UTC (rev 114733)
@@ -418,7 +418,7 @@
this.isSameRMOverrideValue = isSameRMOverrideValue;
}
- public synchronized ManagedConnection createManagedConnection(Subject subject, ConnectionRequestInfo cri)
+ public ManagedConnection createManagedConnection(Subject subject, ConnectionRequestInfo cri)
throws javax.resource.ResourceException
{
if(xadsSelector == null)
@@ -457,7 +457,7 @@
throws javax.resource.ResourceException
{
XAConnection xaConnection = null;
- Properties props = getConnectionProperties(subject, cri);
+ Properties props = getConnectionProperties(null, subject, cri);
try
{
final String user = props.getProperty("user");
@@ -495,7 +495,7 @@
public ManagedConnection matchManagedConnections(Set mcs, Subject subject, ConnectionRequestInfo cri)
throws ResourceException
{
- Properties newProps = getConnectionProperties(subject, cri);
+ Properties newProps = getConnectionProperties(null, subject, cri);
for (Iterator i = mcs.iterator(); i.hasNext();)
{
Object o = i.next();
@@ -519,6 +519,19 @@
}
return null;
}
+
+ /**
+ * Is the properties equal
+ * @param other The other properties
+ * @return True if equal, otherwise false
+ */
+ private boolean isEqual(Map<String, String> other)
+ {
+ synchronized (xaProps)
+ {
+ return xaProps.equals(other);
+ }
+ }
public int hashCode()
{
@@ -538,7 +551,7 @@
if (getClass() != other.getClass())
return false;
XAManagedConnectionFactory otherMcf = (XAManagedConnectionFactory) other;
- return this.xaDataSourceClass.equals(otherMcf.xaDataSourceClass) && this.xaProps.equals(otherMcf.xaProps)
+ return this.xaDataSourceClass.equals(otherMcf.xaDataSourceClass) && isEqual(otherMcf.xaProps)
&& ((this.userName == null) ? otherMcf.userName == null : this.userName.equals(otherMcf.userName))
&& ((this.password == null) ? otherMcf.password == null : this.password.equals(otherMcf.password))
&& this.transactionIsolation == otherMcf.transactionIsolation;
Modified: branches/JBPAPP_5/server/build.xml
===================================================================
--- branches/JBPAPP_5/server/build.xml 2014-02-16 13:11:33 UTC (rev 114732)
+++ branches/JBPAPP_5/server/build.xml 2014-02-17 06:00:46 UTC (rev 114733)
@@ -96,7 +96,7 @@
<path refid="jboss.jboss.mdr.classpath"/>
<path refid="jboss.jbossts.classpath"/>
<path refid="jboss.microcontainer.classpath"/>
- <path refid="jboss.jboss.jpa.deployers.classpath"/>
+ <path refid="jboss.jpa.deployers.classpath"/>
<path refid="jboss.jboss.vfs.classpath"/>
<path refid="jboss.serialization.classpath"/>
<path refid="oswego.concurrent.classpath"/>
More information about the jboss-cvs-commits
mailing list