[jboss-svn-commits] JBL Code SVN: r28620 - labs/jbosstm/workspace/whitingjr/trunk/MVCCSampleSTM/src/main/java/uk/ac/ncl/sdia/a8905943/entitymanager.
jboss-svn-commits at lists.jboss.org
jboss-svn-commits at lists.jboss.org
Thu Jul 30 17:51:30 EDT 2009
Author: whitingjr
Date: 2009-07-30 17:51:30 -0400 (Thu, 30 Jul 2009)
New Revision: 28620
Modified:
labs/jbosstm/workspace/whitingjr/trunk/MVCCSampleSTM/src/main/java/uk/ac/ncl/sdia/a8905943/entitymanager/STMEntityManagerFactoryImpl.java
Log:
Changed to pass to EM the wrapped Connection object.
Modified: labs/jbosstm/workspace/whitingjr/trunk/MVCCSampleSTM/src/main/java/uk/ac/ncl/sdia/a8905943/entitymanager/STMEntityManagerFactoryImpl.java
===================================================================
--- labs/jbosstm/workspace/whitingjr/trunk/MVCCSampleSTM/src/main/java/uk/ac/ncl/sdia/a8905943/entitymanager/STMEntityManagerFactoryImpl.java 2009-07-30 21:50:59 UTC (rev 28619)
+++ labs/jbosstm/workspace/whitingjr/trunk/MVCCSampleSTM/src/main/java/uk/ac/ncl/sdia/a8905943/entitymanager/STMEntityManagerFactoryImpl.java 2009-07-30 21:51:30 UTC (rev 28620)
@@ -133,11 +133,13 @@
}
}
- STMConnection connection = null;
+ //STMConnection connection = null;
+ Connection connection = null;
try
{
// Connection conn = info.getJtaDataSource().getConnection(); -- this doesn't work. Doesn't get a wrappped connection
Object xaConnObject = getDataSource().getConnection();
+ /*
if (xaConnObject instanceof STMXAConnectionImpl)
{
STMXAConnectionImpl xaConnection = (STMXAConnectionImpl) xaConnObject; // this connection should be wrapped by the container
@@ -156,6 +158,8 @@
{
logger.error("Expected XAConnection object should be an instance of STMXAConnection. Given instead ["+xaConnObject.getClass().getName()+"] instance. Will return a plain old Connection.");
}
+ */
+ /*
if (xaConnObject instanceof WrappedConnection)
{
WrappedConnection wrappedConnection = (WrappedConnection) xaConnObject;
@@ -174,7 +178,9 @@
{
logger.info("Underlying conenction is not an instance of WrappedConnection");
}
-
+ */
+ /* pass to the EM the wrapped Connection object */
+ connection = (Connection)xaConnObject;
}
catch (SQLException sqle)
{
More information about the jboss-svn-commits
mailing list