![]() Early Binding of OO4O Objects The early binding technique tightly typecasts OO4O objects to their native object types rather than the generic object type provided by Visual Basic. These objects are declared directly as OO4O objects, rather than as generic objects which are later reclassified as OO4O objects. Early binding improves performance by reducing frequent access to the OO4O type library. For example: 'Early binding of OO4O objects Dim OraSession as OraSession Dim OraDatabase as OraDatabase Dim OraDynaset as OraDynaset 'Generic binding of OO4O objects Dim OraSession as Object Dim OraDatabase as Object Dim OraDynaset as Object To use early binding of OO4O objects, the Oracle In-Process Server type library must be referenced in the Visual Basic projects. Tuning and Customization Data access can be tuned and customized by altering the cache and fetch parameters of a dynaset. Hack samp money. Setting the FetchLimit parameter to a higher value increases the number of rows that are fetched with each request, thus reducing the number of network trips to Oracle Database, and improving performance. The cost of increasing the size of the FetchLimit parameter is that it increases memory requirements on the client side, and causes more data to be swapped to and from the temporary cache file on disk. Error with OLEObjects in vba code (Excel 2010). Method 'OLEObjects' of object '_worksheet' failed'. Method 'OLEObjects' of object '_worksheet' failed' and. The proper FetchLimit value should be set according to the client computer configuration and the anticipated size of the query result. The FetchLimit value can be set in the following ways: • By using the CreateCustomDynaset method • By modifying parameters of the OO4O entry in the Windows registry For Windows, the registry key is HKEY_LOCAL_MACHINE and the subkey is software oracle KEY_ HOMENAME oo4o, where HOMENAME is the appropriate Oracle home. The OO4O installation creates the following section in the registry: 'FetchLimit' = 100. Avoiding Multiple Object Reference Improper coding techniques with unnecessary object references can also affect performance. During dynaset object navigation, you should reduce the number of object references to the OraFields collections and OraField objects. The following is an inefficient code block: 'Create the OraDynaset Object Set OraDynaset = OraDatabase.CreateDynaset('select * from emp', 0&) 'Traverse until EOF is reached Do Until OraDynaset.EOF msgbox OraDynaset.Fields('sal').value OraDynaset.MoveNext Loop The OraDynaset, OraFields collections, and OraField objects are referenced for each iteration. Although OO4O provides improvement in handling the field collections object, multiple references to the automation object goes though the underlying OLE/COM automation layer, which slows down the execution. The following example shows how to reference fields through a field object and not through the fields collection of the dynaset. Testing has determined that this small amount of extra code greatly improves performance. Parameter Bindings OO4O provides a way of enabling and disabling parameter object binding at the time it processes the SQL statement. This can be done through the AutoBindDisable and AutoBindEnable methods of the OraParameter object. If the SQL statement does not contain the parameter name, it is better to disable the OraParameter object because it avoids an unnecessary reference to the parameter object. This is most effective when the application is written primarily using PL/SQL procedures.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. Archives
March 2019
Categories |