[Mono-list] Pooling=false in connectionString cause Unhandled Exception: System.EntryPointNotFoundException: CreateSemaphore

enzo enzo.arlati at libero.it
Sun Aug 26 15:52:53 EDT 2007


Using a simpe program ( the code is reported at the botom ) which simply 
connect to a mysql database a perform a simple select works well if the 
option Pooling in the connectionString is false
If i set it to true ( as string connectionString = 
"Server=localhost;Database=test;User 
ID=test;Password=test;Pooling=true"; ) I got an unhandled exception like 
this

$ mono test1-mysql.exe

Unhandled Exception: System.EntryPointNotFoundException: CreateSemaphore
  at (wrapper managed-to-native) 
MySql.Data.Common.Semaphore:CreateSemaphore 
(MySql.Data.Common.SECURITY_ATTRIBUTES&,int,int,string)
  at MySql.Data.Common.Semaphore..ctor (Int32 initialCount, Int32 
maximumCount) [0x00000]
  at (wrapper remoting-invoke-with-check) 
MySql.Data.Common.Semaphore:.ctor (int,int)
  at MySql.Data.MySqlClient.MySqlPool..ctor 
(MySql.Data.MySqlClient.MySqlConnectionString settings) [0x00000]
  at MySql.Data.MySqlClient.MySqlPoolManager.GetPool 
(MySql.Data.MySqlClient.MySqlConnectionString settings) [0x00000]
  at MySql.Data.MySqlClient.MySqlConnection.Open () [0x00000]

I using mono 1.2.3 on fedora 7 using mysql 5.0.37 and the program was 
build using this command:

$ mcs test1-mysql.cs  -r:System.Data.dll  
-r:/usr/lib/mono/gac/MySql.Data/1.0.10.1__c5687fc88969c44d/MySql.Data.dll


Why this problem with pooling enabled ?

Regards, Enzo


=== sample source code test1-mysql.cs ===

 using System;
 using System.Data;
 using MySql.Data.MySqlClient;
public class Test
 {
    public static void Main(string[] args)
    {

       string connectionString = "Server=localhost;Database=test;" +
                                 "User ID=test;Password=test;" +
                                 "Pooling=false";

       IDbConnection dbcon;
       dbcon = new MySqlConnection(connectionString);
       dbcon.Open();
       IDbCommand dbcmd = dbcon.CreateCommand();

       string sql = "select \"aa\" firstname, \"bbb\" name ";
       dbcmd.CommandText = sql;
       IDataReader reader = dbcmd.ExecuteReader();
       while(reader.Read())
      {
            string firstname = (string) reader["firstname"];
            string name = (string) reader["name"];
            Console.WriteLine("firstname: " +  firstname + " name: " + 
name);
       }
       // clean up
       reader.Close();
       reader = null;
       dbcmd.Dispose();
       dbcmd = null;
       dbcon.Close();
       dbcon = null;
    }
 }

-- 

============================================================================
REPLY TO: perl -e 'print qq^VVCWCQJUVD00YQVWKVBPG^^qq^3898m08970Yp584299l93^ '
  VOIP SKYPE:earlati - VOIP SIP: sip:earlati at ekiga.net
  AIM:earlati - ICQ:321489699 - MSN:enzo.arlati at libero.it
  http: http://earlati.freehostia.com
============================================================================
trusted computing,  who is it ? -->  http://www.p2pforum.it/counter/click.php?id=21 
============================================================================



More information about the Mono-list mailing list