From: NHibernate J. <mik...@us...> - 2006-11-13 20:18:41
|
[ http://jira.nhibernate.org/browse/NH-784?page=comments#action_14381 ] Al Twohill commented on NH-784: ------------------------------- One of the problems as I see it is that there are too many possible causes of this problem: -incorrect value in DriverConnectionProvider field (ie spelling error) -unknown property in session-factory section -missing database driver -missing supporting dlls These can all trigger this issue, and require different resolutions to be made. Because of this I beleive that an exception should always be thrown unless a successful connection is able to be made (be it user supplied or NHb configured). > NHibernate should throw exception on failed driver load > ------------------------------------------------------- > > Key: NH-784 > URL: http://jira.nhibernate.org/browse/NH-784 > Project: NHibernate > Type: Improvement > Components: Data Providers > Versions: 1.2.0.Beta2 > Reporter: Al Twohill > Priority: Trivial > Fix For: 1.2.0.CR1 > > For full background on where this issue arises from, see http://forum.hibernate.org/viewtopic.php?t=966582&highlight= > When Configuration.Configure() is called, if NHibernate is unable to load a database driver for whatever reason (missing dll, incorrect hibernate.cfg.xml, etc) it falls back to returning a UserSuppliedConnectionProvider without an ADO.Net connection attached to it. This causes any use of Session (eg accessing database) to throw an exception. This is extremely difficult to debug, as there is absolutely no indication as to why a UserSuppliedConnectionProvider is returned. > I propose that instead of returning a UserSuppliedConnectionProvider, NHibernate should throw an exception along the lines of "Cannot Load Driver", and give a reason why. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://jira.nhibernate.org/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira |