From: NHibernate J. <mik...@us...> - 2006-11-01 20:57:37
|
[ http://jira.nhibernate.org/browse/NH-784?page=comments#action_14262 ] Fabio Maulo commented on NH-784: -------------------------------- Until now NHb work like Hibernate using UserSuppliedConnectionProvider. The possible solutions, i see, are: - Make DriverConnectionProvider default if no connection.provider is specified in the mapping until DriverConnectionProvider is the unique provider of NHb. - Change the exception of UserSuppliedConnectionProvider adding "Config connection.provider property was not specified". - Exception if an unknown property was found in session-factory section. I think the last option is the best to prevent typing error. > 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 > Reporter: Al Twohill > Priority: Trivial > > 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 |