I'm define a connection provider by inhering the DriverConnectionProvider 
and have the  GetConnection() overriden to open the db connection and 
everything working fine. Now I'm trying to use the async version of the 
same method to open the connection but that doesn't seems to work. Can some 
one help me on this?



return Fluently.Configure()
                .Database(
                    
                    
OracleManagedDataClientConfiguration.Oracle10.Provider<OracleConnectionProvider>().Driver<MiniProfilerOracleDriver>()
                )
                .Mappings(cfg =>
                {
                    
cfg.FluentMappings.AddFromAssemblyOf<NHibernateSessionSource>();
                })
                .BuildConfiguration();


 public class OracleConnectionProvider: DriverConnectionProvider
{

   // This works
     public override DbConnection GetConnection()
        {

            //var connection = new 
ProfiledDbConnection(base.CreateConnection() as DbConnection, 
MiniProfiler.Current).WrappedConnection;
            var connection = (DbConnection)new ProfiledDbConnection(new 
OracleConnection(defaultConnectionString), MiniProfiler.Current);
            connection.Open();
            return connection;
        }

     // This doesn't work
      public override async Task<DbConnection> 
GetConnectionAsync(CancellationToken cancellation = default)
        {
            var connection = (DbConnection)new ProfiledDbConnection(new 
OracleConnection(defaultConnectionString), MiniProfiler.Current);
            await connection.OpenAsync(cancellation);
            return connection;
            
        }
}



How can I make sure that the async works is invoked while opening the DB 
connection ?


-- 
You received this message because you are subscribed to the Google Groups 
"nhusers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/nhusers/6a436552-3cd9-42ef-8b3f-38a7d2542400%40googlegroups.com.

Reply via email to