From: cremor (JIRA) <nh...@gm...> - 2011-05-05 10:33:02
|
[ http://216.121.112.228/browse/NH-2527?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=20998#action_20998 ] cremor commented on NH-2527: ---------------------------- Is there anything else I can provide to help fixing this? > AbstractBatcher reuses disposed IDbCommands which causes an ArgumentOutOfRangeException with OracleDataClientDriver > ------------------------------------------------------------------------------------------------------------------- > > Key: NH-2527 > URL: http://216.121.112.228/browse/NH-2527 > Project: NHibernate > Issue Type: Bug > Components: Core > Affects Versions: 3.0.0.GA > Reporter: cremor > Priority: Critical > Attachments: NH2527 Additional Test.zip, NH2527 Test.zip > > > The attached test shows that the AbstractBatcher reuses already disposed IDbCommands in some cases (in my case, when an OneToMany entry is inserted and updated in the same commit). This seems to be no problem with some (most?) drivers (I tested SQLite20Driver and OracleClientDriver, both had no problems) but causes an ArgumentOutOfRangeException with the OracleDataClientDriver because the Parameters collection is empty. > The dispose is called from AbstractBatcher.CloseCommand() which is called from OneToManyPersister.DoUpdateRows(). > AbstractBatcher.CloseCommand() checks if 'lastQuery' is the just disposed command and if yes clears it, but doesn't check 'batchCommand'. (Possible fix by calling InvalidateBatchCommand() if batchCommand == cmd.) > Seems like a similar problem was already fixed for Firebird because the method AbstractBatcher.PrepareBatchCommand() checks for an empty CommandText and the comment says that it's unknown why it's empty sometimes. (Other possible fix by comparing batchCommand.Parameters.Count and parameterTypes.Length.) > I don't know which of the two fixes would be better (or if there is an even better fix), therefore I didn't create a patch. > Please note that even with one of the two fixes, the test still fails (with an StaleStateException) if you don't set adonet.batch_size to 0. I don't know why it doesn't work with batching, but this seems like a different bug. -- 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 |