Jump to content
MichaelLotosh

Documentation for UpgradeHelper projects

Recommended Posts

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.

Share this post


Link to post
Share on other sites

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?

Share this post


Link to post
Share on other sites

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;

 

Share this post


Link to post
Share on other sites

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,

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. Terms of Use