Bug 27546 - OracleConnection pooling problem
Summary: OracleConnection pooling problem
Status: NEW
Alias: None
Product: Class Libraries
Classification: Mono
Component: System.Data (show other bugs)
Version: 3.12.0
Hardware: PC Windows
: --- normal
Target Milestone: Untriaged
Assignee: Bugzilla
Depends on:
Reported: 2015-03-02 07:11 UTC by JOP
Modified: 2015-09-18 04:33 UTC (History)
2 users (show)

See Also:
Is this bug a regression?: ---
Last known good build:


Description JOP 2015-03-02 07:11:46 UTC
When trying to connect to Oracle database using pooling, I get Unhandled Exception when the program terminates. 

callstack for this error:
Cannot cast from source type to destination type.
  at System.Data.OracleClient.OracleConnectionPoolManager.Dispose () [0x00000] in <filename unknown>:0 
  at System.Data.OracleClient.OracleConnectionPoolManager.Finalize () [0x00000] in <filename unknown>:0

There is quite easy way how to simulate this bug: (this code is almost ctrl+c, ctrl+v from sample how to connect to oracle using mono)
string connectionString = "User ID=xxxx;Data Source=yyyy;password=zzzz;Pooling=true;Min Pool Size=1;Max Pool Size=10";
  using (OracleConnection dbcon = new OracleConnection(connectionString))
  	OracleCommand dbcmd = dbcon.CreateCommand();
  	string sql = "SELECT 1 FROM dual";
  	dbcmd.CommandText = sql;
  	OracleDataReader reader = dbcmd.ExecuteReader();
  	while (reader.Read())
  	// clean up
  	reader = null;
  	dbcmd = null;
  Console.WriteLine("Test");          //this gets printed to console

I managed to simulate this bug either on windows and linux distribution of mono. The error happens all the time. The error does not happen, if I don't use pooling in connection string.
Comment 1 Tatan Sugiana 2015-09-18 04:33:38 UTC
same here, using mono 4.0.4 got the same behaviour

Note You need to log in before you can comment on or make changes to this bug.