MichaelLotosh Posted July 9, 2018 Report Share Posted July 9, 2018 Hello, Do you have any documentation for UpgradeHelper projects? I just had an issue with ADORecordSetHelper.getCommandType function. Our project calls stored procedures without "exec" keyword. getCommandType function is trying to load db schema in order to identify CommandType. Each query loads about 10 times slower with this function. You normally don't see the difference if the form is using couple of SP calls, but on heavy DB forms the difference could be several seconds! getCommandType function even after loading DB schema still ignores SPs and assigns default "Text" type to CommandType. It would've been nice to know before that we don't need this function since it assigns "Text" type to all DB calls anyway. Link to comment Share on other sites More sharing options...
Mobilize.Net Staff OlmanQuesada Posted July 9, 2018 Mobilize.Net Staff Report Share Posted July 9, 2018 Hello Michael, In my understanding, the recordset is populated by executing a stored-procedure. Could you provide us a quick sample of how the recordset is populated? If you use the "exec" keyword when executing stored procedures the results is the expected? Link to comment Share on other sites More sharing options...
MichaelLotosh Posted July 9, 2018 Author Report Share Posted July 9, 2018 I get expected results with or without "exec" keyword. It's just with "exec" keyword I get results 10 times faster. With "exec" keyword the code enters first "if" statement in getCommandType function and exits function right away. Without "exec" keyword the code continues to get DB schema which takes long time. Like I said before, It would be nice to have some documentation to better understand if some functions needs to be modified/removed in UpgradeHelper projects. Here is the sample code that I use to populate recordset: ADORecordSetHelper rs = new ADORecordSetHelper(""); DbConnection connCurrent = UpgradeHelpers.DB.AdoFactoryManager.GetFactory().CreateConnection(); rs.CursorLocation = mCursorLocation; connCurrent.ConnectionString = ConnectionString; connCurrent.Open(); DbCommand TempCommand = null; TempCommand = connCurrent.CreateCommand(); TempCommand.CommandText = "SET ANSI_WARNINGS OFF"; TempCommand.ExecuteNonQuery(); rs.Open(SQLQuery, connCurrent, mLockType); rs.ActiveConnection = null; UpgradeHelpers.DB.TransactionManager.DeEnlist(connCurrent); connCurrent.Close(); connCurrent = null; return rs; Link to comment Share on other sites More sharing options...
Mobilize.Net Staff OlmanQuesada Posted July 10, 2018 Mobilize.Net Staff Report Share Posted July 10, 2018 You can find inline documentation in the helper classes and you're also free to edit them. The recordset helper tries to infer the right command type, but when the basic clauses are not fulfilled it has to get the database schema to find if the recordset is populated by querying to a table name. Retrieving the schema has a very important impact on the performance, so in this case modifying the source code by using the exec keyword would help to reduce the performance. Regards, Link to comment Share on other sites More sharing options...
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now