license not valid due to the problems with dotconnect for oracle installation

license not valid due to the problems with dotconnect for oracle installation

Postby Nirav » Mon 11 Nov 2013 11:10

Hello All,

I have purchased dotConnect for Oracle and add reference in my application and also generate licenses.licx using Tools --> Oracle --> License Information.

1st i got error message like,
License not found. Please view "Licensing" topic in dotConnect for Oracle documentation for details or contact Devart technical support.

but after generate licenses.licx error change with,
license not valid due to the problems with dotconnect for oracle installation

Please help me to fixed this issue as soon as possible. I have also sent mail to Devart Support Team.


Thanks,
Nirav Parikh
Email: nirav@kcspl.co.in
Nirav
 
Posts: 5
Joined: Mon 11 Nov 2013 11:01

Re: license not valid due to the problems with dotconnect for oracle installation

Postby Pinturiccio » Mon 11 Nov 2013 15:59

The "License not valid due to the problems with dotConnect for Oracle installation" exception occurs when you build your application with licenses.licx, but dotConnect for Oracle is not installed on the computer and manually compiled license resource is not added to the project.

There are two ways of making it possible to build a project with the Devart license resource:
1. dotConnect for Oracle should be installed on your build server. dotConnect for Oracle installation with the "Minimal installation" setting helps to solve issues.
2. Compile the license resource manually on the workstation with dotConnect for Oracle installed and adding the result file to your project as an embedded resource. After this you will be able to build your application on your build server without installing dotConnect for Oracle. For more information, please refer to http://www.devart.com/dotconnect/oracle/docs/Licensing.html#compile
Pinturiccio
Devart Team
 
Posts: 1893
Joined: Wed 02 Nov 2011 09:44

Re: license not valid due to the problems with dotconnect for oracle installation

Postby Nirav » Wed 13 Nov 2013 12:06

I have followed your 1st suggestion and succeed,

dot-connect for Oracle should be installed on your build server. dot-connect for Oracle installation with the "Minimal installation" setting helps to solve issues.

License issue sort out but when i run my asp.net application in i got error like,

Could not create the driver from TEST.Models.DevartOracleDriver.

Few days ago in trail version of dot-connect for Oracle i had succeed to connect database in N-hibernate architecture. I have followed below link for connect oracle database with N-hibernate architecture,

http://blog.devart.com/nhibernate_and_oracle.html

Here i also write my code in below,

This is my class file,

Code: Select all
using System;
using System.Reflection;
using NHibernate;
using NHibernate.Cfg;
using NHibernate.Tool.hbm2ddl;

using NHibernate.AdoNet;
using NHibernate.SqlTypes;
using Devart.Data.Oracle;
using NHibernate.Driver;
using System.Data;

namespace TEST.Models
{
    public class DevartOracleDriver : ReflectionBasedDriver, IEmbeddedBatcherFactoryProvider
    {
        private static readonly SqlType GuidSqlType = new SqlType(DbType.Binary, 16);

        public DevartOracleDriver() : base("Devart.Data.Oracle", "Devart.Data.Oracle.NHibernate.NHibernateOracleConnection", "Devart.Data.Oracle.NHibernate.NHibernateOracleCommand")
        {
        }

        public override bool UseNamedPrefixInSql
        {
            get { return true; }
        }

        public override bool UseNamedPrefixInParameter
        {
            get { return false; }
        }

        public override string NamedPrefix
        {
            get { return ":"; }
        }

        protected override void InitializeParameter(IDbDataParameter dbParam, string name, SqlType sqlType)
        {
            if (sqlType.DbType == DbType.Guid)
            {
                base.InitializeParameter(dbParam, name, GuidSqlType);
                OracleParameter oraParam = (OracleParameter)dbParam;
                oraParam.OracleDbType = OracleDbType.Raw;
            }
            else
            {
                base.InitializeParameter(dbParam, name, sqlType);
            }
        }

        #region IEmbeddedBatcherFactoryProvider Members

        System.Type IEmbeddedBatcherFactoryProvider.BatcherFactoryClass
        {
            get { return typeof(OracleDataClientBatchingBatcherFactory); }
        }

        #endregion
    }
}


This is my Web.config details,

Code: Select all
<hibernate-configuration xmlns="urn:nhibernate-configuration-2.2">
    <session-factory>
      <property name="dialect">NHibernate.Dialect.Oracle10gDialect</property>
      <property name="connection.provider">NHibernate.Connection.DriverConnectionProvider</property>
      <property name="connection.driver_class">TEST.Models.DevartOracleDriver, TEST</property>
      <property name="connection.connection_string">server=192.168.1.243;user id=scott;password=tiger;SID=nosaims;port=1521;Direct=True;</property>     
      <property name="show_sql">true</property>
      <property name="proxyfactory.factory_class">NHibernate.ByteCode.Castle.ProxyFactoryFactory, NHibernate.ByteCode.Castle</property>
    </session-factory>
  </hibernate-configuration>


Also added below code in web.config file,

Code: Select all
<runtime>
    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
      <qualifyAssembly partialName="Devart.Data.Oracle" fullName="Devart.Data.Oracle,Version=8.1.26.0, Culture=neutral, PublicKeyToken=09af7300eec23701"/>
    </assemblyBinding>
  </runtime>



Please help me to fixed this issue.
Nirav
 
Posts: 5
Joined: Mon 11 Nov 2013 11:01

Re: license not valid due to the problems with dotconnect for oracle installation

Postby Pinturiccio » Thu 14 Nov 2013 14:00

We could not reproduce the issue. We have performed all the steps from our blog post http://blog.devart.com/nhibernate_and_oracle.html and the application runs successfully.

For reproducing the issue please post here the call stack of the exception and all inner exceptions.

Also please send us a small test project for reproducing the issue.
Pinturiccio
Devart Team
 
Posts: 1893
Joined: Wed 02 Nov 2011 09:44

Re: license not valid due to the problems with dotconnect for oracle installation

Postby Nirav » Fri 15 Nov 2013 08:51

I got error message like this,

NHibernate.HibernateException: Could not create the driver from TEST.Models.DevartOracleDriver, TEST. ---> System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> NHibernate.HibernateException: The IDbCommand and IDbConnection implementation in the assembly Devart.Data.Oracle could not be found. Ensure that the assembly Devart.Data.Oracle is located in the application directory or in the Global Assembly Cache. If the assembly is in the GAC, use <qualifyAssembly/> element in the application configuration file to specify the full name of the assembly.
Nirav
 
Posts: 5
Joined: Mon 11 Nov 2013 11:01

Re: license not valid due to the problems with dotconnect for oracle installation

Postby Pinturiccio » Fri 15 Nov 2013 16:33

Probably you use dotConnect for Oracle Standard edition. You can check the edition of dotConnect for Oracle by selecting About dotConnect for Oracle from the Oracle submenu of the Tools menu in Visual Studio. You will see the dialog box displaying the version and edition of dotConnect for Oracle.

NHibernate runtime is supported only in dotConnect for Oracle Professional edition. For more information, please refer to http://www.devart.com/dotconnect/oracle/editions.html
Pinturiccio
Devart Team
 
Posts: 1893
Joined: Wed 02 Nov 2011 09:44

Re: license not valid due to the problems with dotconnect for oracle installation

Postby Nirav » Tue 19 Nov 2013 12:49

We had purchased Profession edition and it working like charm.

In our application we have total 3 database MSSQL, MYSQL and ORACLE. When i used oracle database and access web application working fine but when i used either MSSQL or MySQL that system must required dotConnect for Oracle professional edition. Why that setup required for MYSQL or MSSQL?

i got error message like,

Could not load file or assembly 'Devart.Data.Oracle' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)

can you please give me alternate solution like without installed dotConnect for Oracle setup my web application working in MSSQL or MYSQL.
Nirav
 
Posts: 5
Joined: Mon 11 Nov 2013 11:01

Re: license not valid due to the problems with dotconnect for oracle installation

Postby Shalex » Wed 20 Nov 2013 11:21

Nirav wrote:When i used oracle database and access web application working fine but when i used either MSSQL or MySQL that system must required dotConnect for Oracle professional edition. Why that setup required for MYSQL or MSSQL?

Looks like your application has references to Devart.Data.dll and Devart.Data.Oracle.dll. That's why you should copy these assemblies with your application.

Nirav wrote:can you please give me alternate solution like without installed dotConnect for Oracle setup my web application working in MSSQL or MYSQL

You can avoid installing dotConnect for Oracle on the target workstation. For this:
1) deploy your application with Devart.Data.dll and Devart.Data.Oracle.dll from dotConnect for Oracle Professional Edition
2) add the license resource to your application (http://www.devart.com/dotconnect/oracle/docs/?licensing.html)
3) register provider in the DbProviderFactories section of your *.config (http://www.devart.com/dotconnect/oracle/docs/?deployment.html)
Shalex
Devart Team
 
Posts: 7460
Joined: Thu 14 Aug 2008 12:44

Re: license not valid due to the problems with dotconnect for oracle installation

Postby Nirav » Wed 20 Nov 2013 11:33

Looks like your application has references to Devart.Data.dll and Devart.Data.Oracle.dll. That's why you should copy these assemblies with your application.


in my application both DLL (Devart.Data.dll and Devart.Data.Oracle.dll) reference exist. When i access from MYSQL or MSSQL and application run i got error message
Could not load file or assembly 'Devart.Data.Oracle' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
Nirav
 
Posts: 5
Joined: Mon 11 Nov 2013 11:01

Re: license not valid due to the problems with dotconnect for oracle installation

Postby Shalex » Wed 20 Nov 2013 14:40

Please specify the call stack with inner exceptions if any and send us a small test project to reproduce the issue in our environment.
Shalex
Devart Team
 
Posts: 7460
Joined: Thu 14 Aug 2008 12:44


Return to dotConnect for Oracle