public Driver(MySqlConnectionStringBuilder settings) { this.connectionString = settings; this.threadId = -1; this.serverCharSetIndex = -1; this.serverCharSet = null; this.hasWarnings = false; this.maxPacketSize = 0x400L; }
public static MySqlPool GetPool(MySqlConnectionStringBuilder settings) { string connectionString = settings.GetConnectionString(true); lock (pools.SyncRoot) { MySqlPool pool = pools[connectionString] as MySqlPool; if (pool == null) { pool = new MySqlPool(settings); pools.Add(connectionString, pool); } else { pool.Settings = settings; } return pool; } }
public MySqlPool(MySqlConnectionStringBuilder settings) { this.minSize = settings.MinimumPoolSize; this.maxSize = settings.MaximumPoolSize; this.available = (int) this.maxSize; this.autoEvent = new AutoResetEvent(false); if (this.minSize > this.maxSize) { this.minSize = this.maxSize; } this.settings = settings; this.inUsePool = new List<Driver>((int) this.maxSize); this.idlePool = new Queue<Driver>((int) this.maxSize); for (int i = 0; i < this.minSize; i++) { this.idlePool.Enqueue(this.CreateNewPooledConnection()); } this.procedureCache = new Shaiya.Extended.Server.MySql.Data.MySqlClient.ProcedureCache((int) settings.ProcedureCacheSize); this.beingCleared = false; }
public MySqlConnection() { this.settings = new MySqlConnectionStringBuilder(); this.advisor = new Shaiya.Extended.Server.MySql.Data.MySqlClient.UsageAdvisor( this ); this.database = string.Empty; }
public NativeDriver(MySqlConnectionStringBuilder settings) : base(settings) { base.isOpen = false; }
public static void ClearPool(MySqlConnectionStringBuilder settings) { ClearPoolByText(settings.GetConnectionString(true)); }
public override void Cancel() { if( !this.connection.driver.Version.isAtLeast( 5, 0, 0 ) ) { throw new NotSupportedException( Resources.CancelNotSupported ); } MySqlConnectionStringBuilder builder = new MySqlConnectionStringBuilder( this.connection.Settings.GetConnectionString( true ) ); builder.Pooling = false; using( MySqlConnection connection = new MySqlConnection( builder.ConnectionString ) ) { connection.Open(); new MySqlCommand( string.Format( "KILL QUERY {0}", this.connection.ServerThread ), connection ).ExecuteNonQuery(); } }
public static Driver Create(MySqlConnectionStringBuilder settings) { Driver driver = null; if (settings.DriverType == MySqlDriverType.Native) { driver = new NativeDriver(settings); } driver.Open(); return driver; }