/*-----------------------------------------------------------------------------
 *
 * Enhydra JdbcS
 * The Initial Developer of the Original Code is Lutris Technologies Inc.
 * Portions created by Lutris are Copyright 1997-2000 Lutris Technologies Inc.
 * All Rights Reserved.
 *
 * The contents of this file are subject to the Enhydra Public License
 * Version 1.1 (the "License"); you may not use this file except in compliance
 * with the License. You may obtain a copy of the License at
 * www.enhydra.org/license/epl.html
 *
 * Software distributed under the License is distributed on an "ASIS" basis,
 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for
 * the specific language governing rights and limitations under the License.
 *
 * -----------------------------------------------------------------------------
 * $Id$
 * -----------------------------------------------------------------------------
 */
package org.enhydra.jdbc.informix;

import org.enhydra.jdbc.standard.*;
import java.sql.*;

public class InformixXAConnection extends StandardXAConnection {
    
    /**
     * Creates the first free connection.
     */
    public InformixXAConnection (InformixXADataSource dataSource, String user, String password) throws SQLException {
	super (dataSource, user, password);	// creates the first Connection object
	
	// Save the constructor parameters.
	this.dataSource = dataSource;
	curCon = new InformixXAStatefulConnection (dataSource, con);// wrap connection as a stateful connection
	
	// NOTE - the current connection is not made known to the data source
	// so it is not eligible for re-use. It only goes on the data source list
	// if it ever becomes associated with a global transaction.

	/*
	// get the timer thread
	if (dataSource.getThreadFactory() != null) {
	    dataSource.log("StandardXAConnection: Getting thread from factory");
	    timerThread = dataSource.getThreadFactory().getThread(this);
	    dataSource.log("StandardXAConnection: Got thread from factory");
	} else {
	    dataSource.log("StandardXAConnection: Getting thread from new Thread()");
	    timerThread = new Thread (this);	// create the backgroup thread to check for timeouts
	}

	timerThread.start();			// start the timer thread
	//timerThread.suspend();			// and suspend until some timeouts get set up
	*/
	dataSource.log("InformixXAConnection created");
    } // constructor

} // class InformixXAConnection
