我使用NHibernate和MySQL开发了一个完整的项目。在开发和测试环境中,一切都没有了。
当我发布我的Web应用程序时,出现了很多错误。最后(我希望)和未解决(直到现在)是例外:
NHibernate.Exceptions.GenericADOException: could not execute query
[ SELECT <QUERY_HERE> ]
Name:cp0 - Value:2012 Name:cp1 - Value:872411
[SQL: <QUERY_HERE>] ---> System.NotSupportedException: Multiple simultaneous connections or connections with different connection strings inside the same transaction are not currently supported.
at MySql.Data.MySqlClient.MySqlConnection.Open()
at NHibernate.Connection.DriverConnectionProvider.GetConnection()
at NHibernate.AdoNet.ConnectionManager.GetConnection()
at NHibernate.AdoNet.AbstractBatcher.Prepare(IDbCommand cmd)
at NHibernate.AdoNet.AbstractBatcher.ExecuteReader(IDbCommand cmd)
at NHibernate.Loader.Loader.GetResultSet(IDbCommand st, Boolean autoDiscoverTypes, Boolean callable, RowSelection selection, ISessionImplementor session)
at NHibernate.Loader.Loader.DoQuery(ISessionImplementor session, QueryParameters queryParameters, Boolean returnProxies)
at NHibernate.Loader.Loader.DoQueryAndInitializeNonLazyCollections(ISessionImplementor session, QueryParameters queryParameters, Boolean returnProxies)
at NHibernate.Loader.Loader.DoList(ISessionImplementor session, QueryParameters queryParameters)
我创建了一个Hibernate会话管理器和一个用于WebApplication的SessinModule。 Hibernate会话是在请求开始时创建的。
我正在使用TransactionScope开始交易。