FileDocCategorySizeDatePackage
LocalManagedConnection.javaAPI DocJBoss 4.2.13651Fri Jul 13 21:01:12 BST 2007org.jboss.resource.adapter.jdbc.local

LocalManagedConnection

public class LocalManagedConnection extends org.jboss.resource.adapter.jdbc.BaseWrapperManagedConnection implements javax.resource.spi.LocalTransaction
LocalManagedConnection
author
David Jencks
author
Adrian Brock
version
$Revision: 57189 $

Fields Summary
Constructors Summary
public LocalManagedConnection(LocalManagedConnectionFactory mcf, Connection con, Properties props, int transactionIsolation, int psCacheSize)

      super(mcf, con, props, transactionIsolation, psCacheSize);
   
Methods Summary
public voidbegin()

      synchronized (stateLock)
      {
         if (inManagedTransaction == false)
         {
            try
            {
               if (underlyingAutoCommit)
               {
                  underlyingAutoCommit = false;
                  con.setAutoCommit(false);
               }
               checkState();
               inManagedTransaction = true;
            }
            catch (SQLException e)
            {
               checkException(e);
            }
         }
         else
            throw new JBossResourceException("Trying to begin a nested local tx");
      }
   
public voidcommit()

      synchronized (stateLock)
      {
         if (inManagedTransaction)
            inManagedTransaction = false;
      }
      try
      {
         con.commit();
      }
      catch (SQLException e)
      {
         checkException(e);
      }
   
public javax.resource.spi.LocalTransactiongetLocalTransaction()

      return this;
   
java.util.PropertiesgetProps()

      return props;
   
public javax.transaction.xa.XAResourcegetXAResource()

      throw new JBossResourceException("Local tx only!");
   
public voidrollback()

      synchronized (stateLock)
      {
         if (inManagedTransaction)
            inManagedTransaction = false;
      }
      try
      {
         con.rollback();
      }
      catch (SQLException e)
      {
         try
         {
            checkException(e);
         }
         catch (Exception e2)
         {
         }
      }