From: <fab...@us...> - 2009-02-07 04:34:55
|
Revision: 4064 http://nhibernate.svn.sourceforge.net/nhibernate/?rev=4064&view=rev Author: fabiomaulo Date: 2009-02-07 04:34:49 +0000 (Sat, 07 Feb 2009) Log Message: ----------- Fix NH-1661 Modified Paths: -------------- trunk/nhibernate/src/NHibernate/Connection/DriverConnectionProvider.cs Modified: trunk/nhibernate/src/NHibernate/Connection/DriverConnectionProvider.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Connection/DriverConnectionProvider.cs 2009-02-07 04:24:29 UTC (rev 4063) +++ trunk/nhibernate/src/NHibernate/Connection/DriverConnectionProvider.cs 2009-02-07 04:34:49 UTC (rev 4064) @@ -12,13 +12,6 @@ private static readonly ILog log = LogManager.GetLogger(typeof(DriverConnectionProvider)); /// <summary> - /// Initializes a new instance of the <see cref="DriverConnectionProvider"/> class. - /// </summary> - public DriverConnectionProvider() - { - } - - /// <summary> /// Closes and Disposes of the <see cref="IDbConnection"/>. /// </summary> /// <param name="conn">The <see cref="IDbConnection"/> to clean up.</param> @@ -42,8 +35,17 @@ { log.Debug("Obtaining IDbConnection from Driver"); IDbConnection conn = Driver.CreateConnection(); - conn.ConnectionString = ConnectionString; - conn.Open(); + try + { + conn.ConnectionString = ConnectionString; + conn.Open(); + } + catch (Exception) + { + conn.Dispose(); + throw; + } + return conn; } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |