This is a migrated thread and some comments may be shown as answers.

How to use managed Oracle driver

6 Answers 359 Views
Databases and Data Types
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Chris
Top achievements
Rank 1
Chris asked on 26 Feb 2014, 06:11 PM
I read that you recently added support for the managed Oracle driver, but I don't see any documentation on how to actually get it in there. The UI tools still only show the unmanaged Oracle option and the provider name is still set to Oracle.DataAccess.Client in both the generated context and the connection string. Any suggestions would be appreciated.

6 Answers, 1 is accepted

Sort by
0
Doroteya
Telerik team
answered on 03 Mar 2014, 07:31 AM
Hello Chris,

Please excuse us for the inconvenience caused.

The consumption of ODP.NET, Managed Driver is performed through a few modifications in the config files of the applications that utilize Telerik Data Access. Prior to them, you need to have the driver installed and configured. The requirement on the Telerik Data Access side is the version of the driver to be 4.121.1.0. The following steps will guide you through the process:

1. In case the driver is not already at your disposal, the Oracle packages that distribute it are listed and available for download in this article.
2. The An Easy Drive to .NET article contains a tutorial for installing and configuring the driver according to your scenario. The sections in it that you may find of interest are: Installing ODP.NET, Managed Driver, and Networking Configuration with ODP.NET, Managed Driver.
3. To utilize the driver in the applications, which use Telerik Data Access, you need to provide Oracle.ManagedDataAccess.Client as a value for the providerName attribute in the connection string used for instantiating the context. For example:
<connectionStrings>
    <add name="DBConnection"
         connectionString="data source=XE;user id=X;password=X"
         providerName="Oracle.ManagedDataAccess.Client"/>
</connectionStrings>
At this point, make sure to provide the specified providerName value not only in the config files of the projects that hold Telerik Data Access models, but in the config files of the projects, which consume them, as well. This setting is obtained by Telerik Data Access during runtime and the respective driver is loaded.
4. To test the configuration, you can use the Modules window in Visual Studio during a debug session of the data access layer.
 
Additionally, let me assure you that the update of our documentation with the relevant information is already in process. Once it is available, I will make sure to notify you in this thread.
 
I hope this helps. In case you need further assistance or have additional questions, do not hesitate to get back to us.Regards,
Doroteya
Telerik
OpenAccess ORM is now Telerik Data Access. For more information on the new names, please, check out the Telerik Product Map.
0
Doroteya
Telerik team
answered on 10 Mar 2014, 07:06 AM
Hello Chris,

Thank you for your patience and understanding.

Please kindly find the Oracle section of our documentation updated with a guide about the consumption of the managed driver.

In case you have questions, or need assistance, do not hesitate to get back to us.


Regards,
Doroteya
Telerik
OpenAccess ORM is now Telerik Data Access. For more information on the new names, please, check out the Telerik Product Map.
0
Mohamed
Top achievements
Rank 2
answered on 19 Dec 2014, 07:03 AM
Hello,
I've changed the provider from Unmanaged to Managed and followed the Telerik Oracle documentations (changing the connectionstring to include the managed provider).

Now my problem is that current generated entities model still points at the unmanaged namespace.

My static getbackendconfiguration method gets the provider correctly.

How to resolve this issue of forcing telerik data access to regenerate entities model to use Oracle.ManagedDataAccess?
0
Doroteya
Telerik team
answered on 19 Dec 2014, 02:57 PM
Hello Muhamed,

Based on the provided information, I was unable to completely understand your scenario. Can you provide me with the following details:

1. To which version of the Oracle.DataAccess assembly does your project refer to? (Note that Telerik Data Access supports only version 4.121.1.0 of the managed driver, and if you are consuming it in your code, this is the version you should refer to)
2. What objects does your model contain (tables, views, stored procedures, db functions)?
3. If it contains stored procedures and functions, are they mapped to domain methods?

Any additional information you find relevant will be highly appreciated as well.

I am looking forward to your feedback.


Regards,
Doroteya
Telerik
 
OpenAccess ORM is now Telerik Data Access. For more information on the new names, please, check out the Telerik Product Map.
 
0
Mohamed
Top achievements
Rank 2
answered on 22 Dec 2014, 03:38 PM
Oracle.DataAccess is the unmanaged drive that I was using in initially building the model. I decided to change it to the 4.121.1.0 Oracle.ManagedDataAccess instead for performance gains and deployment issues.

I've deleted the current connection string and added new one through telerik update database from model wizard with the new managed provider.

I noticed the problem only with my generated domain method from the stored procedures are still using the unmanaged driver. I tried to change them manually and everything works perfectly. Of course if I the entities model regenerates the code files it replaces my code again with the unmanaged driver.

I'm using the latest version available of Telerik Data Access.

As I mentioned  earlier in my post the generated back end configuration reads the provider correctly as per the below code:

Oracle.DataAccess is the unmanaged drive that I was using in initially building the model. I decided to change it to the 4.121.1.0 Oracle.ManagedDataAccess instead for performance gains and deployment issues.

I've deleted the current connection string and added new one through telerik update database from model wizard with the new managed provider.

I noticed the problem only with my generated domain method from the stored procedures are still using the unmanaged driver. I tried to change them manually and everything works perfectly. Of course if I the entities model regenerates the code files it replaces my code again with the unmanaged driver.

I'm using the latest version available of Telerik Data Access.

As I mentioned  earlier in my post the generated back end configuration reads the provider correctly as per the below code:

public static BackendConfiguration GetBackendConfiguration()
{
BackendConfiguration backend = new BackendConfiguration();
backend.Backend = "Oracle";
backend.ProviderName = "Oracle.ManagedDataAccess.Client";
backend.Logging.MetricStoreSnapshotInterval = 0;
backend.Runtime.ReturnNullForRowNotFound = true;

CustomizeBackendConfiguration(ref backend);

return backend;
}

The problem is that all SP domain methods did not update to the new Managed drivers as per the code below:

// Oracle.DataAccess assembly reference is required
Oracle.DataAccess.Client.OracleParameter parameterPRC = new Oracle.DataAccess.Client.OracleParameter();

This should be Oracle.ManagedDataAccess.

I need to know what i need to do to make the model generate through the update provider.


Thanks for your support.
0
Doroteya
Telerik team
answered on 23 Dec 2014, 10:51 AM
Hi Mohamed,

Thank you for the additional details.

In general, there is no out-of-the-box solution for this situation, although the change is possible. The implementation involves a small change in the code generation templates used by Telerik Data Access. The downside is that from the moment you make this change, you need to treat the templates as an inseparable part of your project (more details are available in this article). If you find this feasible, following are the steps you can take:

1. Open the .rlinq file in Visual Designer.
2. Right-click on the surface of the designer and select Show Model Settings... in order to start the Model Settings dialogue.
3. In the Code Generation tab, select the Custom Defined option in the Code Generation Template section.
4. To copy the templates locally in your project click on the Copy Default To... button and provide a convenient folder in the Select Folder dialogue.
5. Click OK to close the Select Folder dialogue and then OK to close the Model Settings dialogue.
6. In the folder you selected in the Select Folder dialogue, locate the DomainMethodsGenerator.ttinclude template, and open it.
7. On line 559, paste the following code:
Oracle.ManagedDataAccess.Client.OracleParameter <#=variableName#> = new Oracle.ManagedDataAccess.Client.OracleParameter();
8. On line 561, paste the following code:
<#=variableName#>.OracleDbType = Oracle.ManagedDataAccess.Client.OracleDbType.RefCursor;
9. Save the template.
10. Make sure that your project contains a reference to the Oracle.ManagedDataAccess assembly.
11. Explicitly save the .rlinq file, so that the changes are applied (if you have to, move a class in the diagram, in order to make an irrelevant change, which will trigger the code generation on save).

At this point, the domain methods will use the Oracle.ManagedDataAccess.* namespaces.

I hope this helps. If you need further information or assistance, do let us know.



Regards,
Doroteya
Telerik
 
OpenAccess ORM is now Telerik Data Access. For more information on the new names, please, check out the Telerik Product Map.
 
Tags
Databases and Data Types
Asked by
Chris
Top achievements
Rank 1
Answers by
Doroteya
Telerik team
Mohamed
Top achievements
Rank 2
Share this question
or