From: Fabio M. (JIRA) <nh...@gm...> - 2011-05-17 22:39:54
|
[ http://216.121.112.228/browse/NH-2088?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=21110#action_21110 ] Fabio Maulo commented on NH-2088: --------------------------------- If you have a patch you can send it freely. > IO APM Implement in NHibernate > ------------------------------ > > Key: NH-2088 > URL: http://216.121.112.228/browse/NH-2088 > Project: NHibernate > Issue Type: New Feature > Components: Core > Affects Versions: 3.0.0.Alpha1 > Reporter: li yongjing > Priority: Major > > many people hope a IO APM(http://msdn.microsoft.com/en-us/magazine/cc163467.aspx) Implement in NHibernate. We use SQL Server 2005 and we are building a client software. Now we have to execute SQL in UI Thread because of Session is not thread safe. It will display "No Respongding" in our application when a great amount of data to Submit to DB. > We know .net framework support IO-APM from version 2.0. The class SQLCommand has a method called "BeginExecuteNonQuery" and "EndExecuteNonQuery", It implements standard APM pattern. So We can use it to send async request to SQL Server. It return immediatly. When Database finished, It will callback and send the data We need. IO APM do not need another thread, just use hardware IOCP. So it will save computer resource and cost less CPU time. Some .net FCL implement APM, such as Stream.BeginRead, Delegate.BeginInvoke, SQLCommand.BeginExecuteNonQuery. As you know, .NET 4.0 enhance parallel task to use multicore support. We think if NHibernate implement APM will take full advantage of hardware support. > We have a glance at NHibernate source, We find it use the interface "IDBCommand.ExecuteNonQuery". The APM support only occurs in SQLCommand. So can you add a callback method like "IAsyncResult BeginExecuteNonQuery(AsyncCallback callback, object stateObject)? Although it only support SQL Server, it can decrease UI responding time and less cost of CPU resource. > In our opinion, If this function occurs in the next version, everyone who use NHibernate will reap the benefits of APM async pattern. > So could you help us to let NHibernate support APM? If you have any idea, please contact with us freely. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://216.121.112.228/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira |