[jboss-svn-commits] JBL Code SVN: r19962 - labs/jbosstm/branches/JBOSSTS_4_2_3_GA_SP/ArjunaJTA/jdbc/classes/com/arjuna/ats/internal/jdbc.
jboss-svn-commits at lists.jboss.org
jboss-svn-commits at lists.jboss.org
Thu May 15 08:27:59 EDT 2008
Author: jhalliday
Date: 2008-05-15 08:27:58 -0400 (Thu, 15 May 2008)
New Revision: 19962
Modified:
labs/jbosstm/branches/JBOSSTS_4_2_3_GA_SP/ArjunaJTA/jdbc/classes/com/arjuna/ats/internal/jdbc/IndirectRecoverableConnection.java
Log:
backported IndirectRecoverableConnection constructor fix from trunk. JBTM-364
Modified: labs/jbosstm/branches/JBOSSTS_4_2_3_GA_SP/ArjunaJTA/jdbc/classes/com/arjuna/ats/internal/jdbc/IndirectRecoverableConnection.java
===================================================================
--- labs/jbosstm/branches/JBOSSTS_4_2_3_GA_SP/ArjunaJTA/jdbc/classes/com/arjuna/ats/internal/jdbc/IndirectRecoverableConnection.java 2008-05-15 12:23:53 UTC (rev 19961)
+++ labs/jbosstm/branches/JBOSSTS_4_2_3_GA_SP/ArjunaJTA/jdbc/classes/com/arjuna/ats/internal/jdbc/IndirectRecoverableConnection.java 2008-05-15 12:27:58 UTC (rev 19962)
@@ -1,20 +1,20 @@
/*
* JBoss, Home of Professional Open Source
- * Copyright 2006, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags.
* See the copyright.txt in the distribution for a
- * full listing of individual contributors.
+ * full listing of individual contributors.
* This copyrighted material is made available to anyone wishing to use,
* modify, copy, or redistribute it subject to the terms and conditions
* of the GNU Lesser General Public License, v. 2.1.
- * This program is distributed in the hope that it will be useful, but WITHOUT A
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+ * This program is distributed in the hope that it will be useful, but WITHOUT A
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
* PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
* You should have received a copy of the GNU Lesser General Public License,
* v.2.1 along with this distribution; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
* MA 02110-1301, USA.
- *
+ *
* (C) 2005-2006,
* @author JBoss Inc.
*/
@@ -24,7 +24,7 @@
* Arjuna Solutions Limited,
* Newcastle upon Tyne,
* Tyne and Wear,
- * UK.
+ * UK.
*
* $Id: IndirectRecoverableConnection.java 2342 2006-03-30 13:06:17Z $
*/
@@ -83,23 +83,9 @@
_theXAResource = null;
_theTransaction = null;
_theArjunaConnection = null;
-
- /*
- * Create a jndi specific modifier first, so that we can then
- * use this to find out what the end-point datasource really
- * is.
- */
-
- // why do we do this?
-
- com.arjuna.ats.internal.jdbc.drivers.modifiers.jndi jndiModifier = new com.arjuna.ats.internal.jdbc.drivers.modifiers.jndi();
-
- _dbName = jndiModifier.initialise(_dbName);
_theModifier = null;
-
- createDataSource();
}
-
+
public IndirectRecoverableConnection (String dbName, String user,
String passwd,
ConnectionImple conn) throws SQLException
@@ -127,7 +113,7 @@
com.arjuna.ats.internal.jdbc.drivers.modifiers.jndi jndiModifier = new com.arjuna.ats.internal.jdbc.drivers.modifiers.jndi();
- _dbName = jndiModifier.initialise(_dbName);
+ _dbName = jndiModifier.initialise(_dbName);
_theModifier = null;
createDataSource();
@@ -154,9 +140,9 @@
jdbcLogger.loggerI18N.warn("com.arjuna.ats.internal.jdbc.drcdest",
new Object[] {e});
}
- }
+ }
}
-
+
public boolean packInto (OutputObjectState os)
{
if (jdbcLogger.logger.isDebugEnabled())
@@ -178,7 +164,7 @@
return false;
}
}
-
+
public boolean unpackFrom (InputObjectState os)
{
if (jdbcLogger.logger.isDebugEnabled())
@@ -192,7 +178,7 @@
_dbName = os.unpackString();
_user = os.unpackString();
_passwd = os.unpackString();
-
+
return true;
}
catch (Exception e)
@@ -273,11 +259,11 @@
if (_theTransaction == null)
{
_theTransaction = tx;
-
+
return true;
}
}
-
+
/*
* In case we have already set it for this transaction.
*/
@@ -288,13 +274,13 @@
public boolean validTransaction (javax.transaction.Transaction tx)
{
boolean valid = true;
-
+
if (_theTransaction != null)
valid = _theTransaction.equals(tx);
-
+
return valid;
}
-
+
/*
* If there is a connection then return it. Do not create a
* new connection otherwise.
@@ -304,7 +290,7 @@
{
return _theConnection;
}
-
+
public XAConnection getConnection () throws SQLException
{
if (jdbcLogger.logger.isDebugEnabled())
@@ -322,17 +308,17 @@
createConnection();
}
}
-
+
return _theConnection;
}
catch (Exception e)
{
e.printStackTrace();
-
+
throw new SQLException(e.toString());
}
}
-
+
public XADataSource getDataSource () throws SQLException
{
if (jdbcLogger.logger.isDebugEnabled())
@@ -348,12 +334,12 @@
{
return (boolean) (_theXAResource != null);
}
-
+
public String user ()
{
return _user;
}
-
+
public String password ()
{
return _passwd;
@@ -363,7 +349,7 @@
{
return _dbName;
}
-
+
public String dynamicClass ()
{
return "";
@@ -402,7 +388,7 @@
{
Hashtable env = new Hashtable();
Enumeration e = jdbcPropertyManager.propertyManager.propertyNames();
-
+
/*
* Look through the properties for any Context related
* stuff.
@@ -411,7 +397,7 @@
while (e.hasMoreElements())
{
String name = (String) e.nextElement();
-
+
if (name.startsWith("Context."))
env.put(translate(name), jdbcPropertyManager.propertyManager.getProperty(name));
}
@@ -435,11 +421,11 @@
catch (Exception e)
{
e.printStackTrace();
-
+
throw new SQLException(e.toString());
}
}
-
+
private final void createConnection () throws SQLException
{
try
@@ -459,7 +445,7 @@
catch (Exception e)
{
e.printStackTrace();
-
+
throw new SQLException(e.toString());
}
}
@@ -512,7 +498,7 @@
{
// name is null
}
-
+
return name;
}
@@ -525,5 +511,5 @@
private javax.transaction.Transaction _theTransaction;
private ConnectionImple _theArjunaConnection;
private ConnectionModifier _theModifier;
-
+
}
More information about the jboss-svn-commits
mailing list