Examples of ManagedConnection


Examples of com.esri.gpt.framework.sql.ManagedConnection

    }
    sbSql.append(" ORDER BY ");
    sbSql.append(sOrderByColumn).append(" ").append(sOrderByDir);

    // establish the connection
    ManagedConnection mc = returnConnection();
    Connection con = mc.getJdbcConnection();
   
    // prepare the statements
    int n = 0;
    st = con.prepareStatement(sbSql.toString());
    stCount = con.prepareStatement(sbCount.toString());
View Full Code Here

Examples of javax.resource.spi.ManagedConnection

        if (out != null)
            out.print("Failed connecting process: " + exc);
      throw new ResourceException("Failed connecting process: " + exc);
    }

    ManagedConnection managedCx = new ManagedConnectionImpl(ra,
                                                            cnx,
                                                            hostName,
                                                            serverPort,
                                                            userName);
    managedCx.setLogWriter(out);

    if (AdapterTracing.dbgAdapter.isLoggable(BasicLevel.DEBUG))
      AdapterTracing.dbgAdapter.log(BasicLevel.DEBUG,
                                    this + " createManagedConnection managedCx = " + managedCx);
View Full Code Here

Examples of javax.resource.spi.ManagedConnection

        if (out != null)
            out.print("Failed connecting process: " + exc);
      throw new ResourceException("Failed connecting process: " + exc);
    }

    ManagedConnection managedCx = new ManagedConnectionImpl(ra,
                                                            cnx,
                                                            hostName,
                                                            serverPort,
                                                            userName);
    managedCx.setLogWriter(out);

    if (AdapterTracing.dbgAdapter.isLoggable(BasicLevel.DEBUG))
      AdapterTracing.dbgAdapter.log(BasicLevel.DEBUG,
                                    this + " createManagedConnection managedCx = " + managedCx);
View Full Code Here

Examples of javax.resource.spi.ManagedConnection

  void reconnect() {
    valid = true;
    try {
      ManagedConnectionFactoryImpl mcf = new ManagedConnectionFactoryImpl();
      mcf.setResourceAdapter(ra);
      ManagedConnection mc = mcf.createManagedConnection(subject, cxRequest);
      destroy();
    catch (Exception e) {
      if (AdapterTracing.dbgAdapter.isLoggable(BasicLevel.DEBUG))
        AdapterTracing.dbgAdapter.log(BasicLevel.DEBUG, this + " reconnect exception " + e);
    }
View Full Code Here

Examples of javax.resource.spi.ManagedConnection

    }
    public Object allocateConnection(ManagedConnectionFactory mcf,
                                     ConnectionRequestInfo cxRequestInfo)
        throws ResourceException{
        ManagedConnection mc = mcf.createManagedConnection(null,cxRequestInfo);
        ConnectionListener l = new ConnectionListener(mc);
        mc.addConnectionEventListener(l);
        return mc.getConnection(null,cxRequestInfo);

    }
View Full Code Here

Examples of javax.resource.spi.ManagedConnection

      {
         // We have a hanging transaction
         if (localTransaction.get())
         {
            LocalTransaction local = null;
            ManagedConnection mc = getManagedConnection();
            try
            {
               local = mc.getLocalTransaction();
            }
            catch (Throwable t)
            {
               JBossResourceException.rethrowAsResourceException("Unfinished local transaction - error getting local transaction from " + this, t);
            }
View Full Code Here

Examples of javax.resource.spi.ManagedConnection

            Subject subject = getSubject();

            // Check if we got a valid Subject instance; requirement for recovery
            if (subject != null)
            {
               ManagedConnection mc = open(subject);
               XAResource xaResource = null;

               try
               {
                  xaResource = mc.getXAResource();
               }
               catch (ResourceException reconnect)
               {
                  close(mc);
                  mc = open(subject);
                  xaResource = mc.getXAResource();
               }

               try
               {
                  ObjectName on = new ObjectName(connectionManager);

                  boolean wrapXAResource = false;
                  boolean padXid = false;
                  Boolean isSameRMOverrideValue = Boolean.FALSE;

                  Boolean b = null;

                  b = (Boolean)getServer().getAttribute(on, "WrapXAResource");
                  if (b != null)
                     wrapXAResource = b.booleanValue();

                  b = (Boolean)getServer().getAttribute(on, "PadXid");
                  if (b != null)
                     padXid = b.booleanValue();

                  b = (Boolean)getServer().getAttribute(on, "IsSameRMOverrideValue");
                  if (b != null)
                     isSameRMOverrideValue = b;

                  if(wrapXAResource)
                  {
                     String eisProductName = null;
                     String eisProductVersion = null;

                     try
                     {
                        eisProductName = mc.getMetaData().getEISProductName();
                        eisProductVersion = mc.getMetaData().getEISProductVersion();
                     }
                     catch (ResourceException re)
                     {
                        // Ignore
                     }
View Full Code Here

Examples of javax.resource.spi.ManagedConnection

              InternalManagedConnectionPool internalPool = subContext.getSubPool();
              Set cels = internalPool.getConnectionListeners();
              for(Iterator celsIter = cels.iterator(); celsIter.hasNext();)
              {
                 ConnectionListener cl = (ConnectionListener) celsIter.next();
                 ManagedConnection mc = cl.getManagedConnection();
                 if (mc instanceof org.jboss.resource.statistic.JBossConnectionStatistics)
                 {
                    org.jboss.resource.statistic.JBossConnectionStatistics stats = (org.jboss.resource.statistic.JBossConnectionStatistics)mc;
                    statistics += stats.listConnectionStats();
                    if(statistics.startsWith("-1")){
View Full Code Here

Examples of javax.resource.spi.ManagedConnection

    * @throws ResourceException for any error
    */
   private ConnectionListener createConnectionEventListener(Subject subject, ConnectionRequestInfo cri)
         throws ResourceException
   {
      ManagedConnection mc = mcf.createManagedConnection(subject, cri);
      connectionCounter.inc();
      try
      {
         return clf.createConnectionListener(mc, this);
      }
      catch (ResourceException re)
      {
         connectionCounter.dec();
         mc.destroy();
         throw re;
      }
   }
View Full Code Here

Examples of org.apache.commons.dbcp.managed.ManagedConnection

        // the first "cast part" is not important, we just want to check the jdbc url is ok
        assertThat(ds, instanceOf(BasicManagedDataSource.class));
        final BasicManagedDataSource dbcp = (BasicManagedDataSource) ds;
        final Connection connection = dbcp.getConnection();
        assertThat(connection, instanceOf(ManagedConnection.class));
        final ManagedConnection mc = (ManagedConnection) connection;
        final Method getInnermostDelegateInternal = DelegatingConnection.class.getDeclaredMethod("getInnermostDelegateInternal");
        getInnermostDelegateInternal.setAccessible(true);
        final Connection delegate = (Connection) getInnermostDelegateInternal.invoke(mc);
        assertThat(delegate, instanceOf(JDBCConnection.class));
        final Method getURL = JDBCConnection.class.getDeclaredMethod("getURL");
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.