public void NpgsqlErrorRepro2()
{
#if WHAT_TO_DO_WITH_THIS
var connection = new NpgsqlConnection(ConnectionString);
connection.Open();
var transaction = connection.BeginTransaction();
var largeObjectMgr = new LargeObjectManager(connection);
try
{
var largeObject = largeObjectMgr.Open(-1, LargeObjectManager.READWRITE);
transaction.Commit();
}
catch
{
// ignore the LO failure
try
{
transaction.Dispose();
}
catch
{
// ignore dispose failure
}
try
{
connection.Dispose();
}
catch
{
// ignore dispose failure
}
}
using (connection = new NpgsqlConnection(ConnectionString))
{
connection.Open();
using (var command = connection.CreateCommand())
{
command.CommandText = "SELECT * FROM pg_database";
using (var reader = command.ExecuteReader())
{
Assert.IsTrue(reader.Read());
// *1* this fails if the connection for the pool happens to be the bad one from above
Assert.IsTrue(!String.IsNullOrEmpty((string)reader["datname"]));
}
}
}
#endif
}