Examples of EmbedConnection


Examples of org.apache.derby.impl.jdbc.EmbedConnection

        synchronized (tranState) {
            // global transaction is over.
            tranState.associationState = XATransactionState.TC_COMPLETED;
            tranState.notifyAll();
           
            EmbedConnection conn = tranState.conn;
           
            // already set in its own resource
            // or can it be returned to its original resource?
            if ((tranState.creatingResource.con.realConnection == conn) ||
                    (tranState.creatingResource.con.realConnection == null)) {
               
                tranState.creatingResource.con.realConnection = conn;
               
                BrokeredConnection handle =
                        tranState.creatingResource.con.currentConnectionHandle;
               
                conn.setApplicationConnection(handle);
               
                if (handle != null) {
                    try {
                        handle.setState(true);
                    } catch (SQLException sqle) {
View Full Code Here

Examples of org.apache.derby.impl.jdbc.EmbedConnection

        synchronized (tranState) {
            // global transaction is over.
            tranState.associationState = XATransactionState.TC_COMPLETED;
            tranState.notifyAll();
           
            EmbedConnection conn = tranState.conn;
           
            // already set in its own resource
            // or can it be returned to its original resource?
            if ((tranState.creatingResource.con.realConnection == conn) ||
                    (tranState.creatingResource.con.realConnection == null)) {
               
                tranState.creatingResource.con.realConnection = conn;
               
                BrokeredConnection handle =
                        tranState.creatingResource.con.currentConnectionHandle;
               
                conn.setApplicationConnection(handle);
               
                if (handle != null) {
                    try {
                        handle.setState(true);
                    } catch (SQLException sqle) {
View Full Code Here

Examples of org.apache.derby.impl.jdbc.EmbedConnection

   * @return A nested connection object.
   *
   */
  public Connection getNewNestedConnection(EmbedConnection conn)
  {
    return new EmbedConnection(conn);
  }
View Full Code Here

Examples of org.apache.derby.impl.jdbc.EmbedConnection

   */
  public EmbedConnection getNewEmbedConnection(String url, Properties info)
     throws SQLException
  {
    // make a new local connection with a new transaction resource
    return new EmbedConnection(this, url, info);
  }
View Full Code Here

Examples of org.apache.derby.impl.jdbc.EmbedConnection

                throw new XAException(XAException.XAER_PROTO);
           
            if (tranState.isPrepared == onePhase)
                throw new XAException(XAException.XAER_PROTO);
           
            EmbedConnection conn = tranState.conn;
           
            try {
                conn.xa_commit(onePhase);
            } catch (SQLException sqle) {
                throw wrapInXAException(sqle);
            } finally {
                returnConnectionToResource(tranState, xid_im);
            }
View Full Code Here

Examples of org.apache.derby.impl.jdbc.EmbedConnection

                throw new XAException(XAException.XAER_PROTO);
           
            if (tranState.isPrepared)
                throw new XAException(XAException.XAER_PROTO);
           
            EmbedConnection conn = tranState.conn;
           
            try {
               
                int ret = conn.xa_prepare();
               
                if (ret == XATransactionController.XA_OK) {
                    tranState.isPrepared = true;
                   
                    return XAResource.XA_OK;
View Full Code Here

Examples of org.apache.derby.impl.jdbc.EmbedConnection

        synchronized (tranState) {
            // global transaction is over.
            tranState.associationState = XATransactionState.TC_COMPLETED;
            tranState.notifyAll();
           
            EmbedConnection conn = tranState.conn;
           
            // already set in its own resource
            // or can it be returned to its original resource?
            if ((tranState.creatingResource.con.realConnection == conn) ||
                    (tranState.creatingResource.con.realConnection == null)) {
               
                tranState.creatingResource.con.realConnection = conn;
               
                BrokeredConnection handle =
                        tranState.creatingResource.con.currentConnectionHandle;
               
                conn.setApplicationConnection(handle);
               
                if (handle != null) {
                    try {
                        handle.setState(true);
                    } catch (SQLException sqle) {
View Full Code Here

Examples of org.apache.derby.impl.jdbc.EmbedConnection

     */
    public static void checkEstimatedRowCount(Connection conn, double expectedCount) throws SQLException {
  if (! (conn instanceof EmbedConnection))
      return;
 
  EmbedConnection econn = (EmbedConnection) conn;
  RunTimeStatistics rts = econn.getLanguageConnection().getRunTimeStatisticsObject();
  assertNotNull(" RuntimeStatistics is null. Did you call SYSCS_UTIL.SYSCS_SET_RUNTIMESTATISTICS(1)?",rts);
  assertEquals((long) expectedCount, (long) rts.getEstimatedRowCount());
  }
View Full Code Here

Examples of org.apache.derby.impl.jdbc.EmbedConnection

     */
    public static void checkEstimatedRowCount(Connection conn, double expectedCount) throws SQLException {
  if (! (conn instanceof EmbedConnection))
      return;
 
  EmbedConnection econn = (EmbedConnection) conn;
  RunTimeStatistics rts = econn.getLanguageConnection().getRunTimeStatisticsObject();
  assertNotNull(" RuntimeStatistics is null. Did you call SYSCS_UTIL.SYSCS_SET_RUNTIMESTATISTICS(1)?",rts);
  assertEquals((long) expectedCount, (long) rts.getEstimatedRowCount());
  }
View Full Code Here

Examples of org.apache.derby.impl.jdbc.EmbedConnection

        throw new XAException(XAException.XAER_PROTO);

      if (tranState.isPrepared)
        throw new XAException(XAException.XAER_PROTO);

      EmbedConnection conn = tranState.conn;

      try {

        int ret = conn.xa_prepare();

        if (ret == XATransactionController.XA_OK) {
          tranState.isPrepared = true;

          return XAResource.XA_OK;
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.