-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 7 posts ] 
Author Message
 Post subject: Doubt (for developers)
PostPosted: Fri Jun 23, 2006 5:49 am 
Regular
Regular

Joined: Thu May 11, 2006 12:30 pm
Posts: 72
i'm experiencing a problem using NH 1.2.0 alpha, both with Oracle and DB2/400; it seems that NH doesn't load my nhibernate section from App.config:

    <configSections>
    <section name="nhibernate" type="System.Configuration.NameValueSectionHandler, System, Version=1.0.5000.0,Culture=neutral, PublicKeyToken=b77a5c561934e089" />
    <section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler,log4net" />
    </configSections>

    <nhibernate>
    <add key="hibernate.connection.provider" value="NHibernate.Connection.DriverConnectionProvider" />
    <add key="hibernate.dialect" value="NHibernate.Dialect.DB2Dialect" />
    <add key="hibernate.connection.driver_class" value="NHibernate.Driver.DB2Driver" />
    <add key="hibernate.connection.connection_string" value="DataSource=1.2.3.4;userid=xxx;password=xxx;LibraryList=MYLIBRARY;Naming=SQL;" />
    <add key="hibernate.show_sql" value="true" />
    </nhibernate>


with NH 1.0.2 all works fine, but if i use 1.2.0 alpha not.

so i've included source NH (2.0) project instead of binary and i'd debug it: there are not any Configure overload that load NH properties from App.config like mine (with <nhibernate> section); there is only an overload that load from <nhibernate-configuration>...

it's correct, and in the future this is the way or is a bug/todo thing ?

regards


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jun 23, 2006 6:25 am 
Contributor
Contributor

Joined: Wed May 11, 2005 4:59 pm
Posts: 1766
Location: Prague, Czech Republic
This looks like a bug, please report it, including a test case.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jun 23, 2006 6:38 am 
Regular
Regular

Joined: Thu May 11, 2006 12:30 pm
Posts: 72
i'm again investigating because seems that DB2Driver thrown another Exception (now i'm using the hibernate.cfg.xml instead of app.config)

i think in case i can write directly a fix


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jun 23, 2006 6:57 am 
Regular
Regular

Joined: Thu May 11, 2006 12:30 pm
Posts: 72
sergey i've found the source of the problem...

in the latest release of IBM .NET data provider, they changed the namespace and name of the dll;so when NH try to create the driver thrown an exception that tell me the following message:

    The IDbCommand and IDbConnection implementation in the assembly IBM.Data.DB2 could not be found. Please ensure that the assembly IBM.Data.DB2 is in the Global Assembly Cache or in a location that NHibernate can use System.Type.GetType(string) to load the types from.


effectively in the NH DB2Driver.cs there is this code

Code:
public DB2Driver() : base (
   "IBM.Data.DB2",
            "IBM.Data.DB2.DB2Connection",
            "IBM.Data.DB2.DB2Command" )
      {
      }


but in the new namespace dll name is IBM.Data.DB2.iSeries.dll and not IBM.Data.DB2.dll, then the classes are iDB2Connection, iDB2Command with i as prefix!

Version info
IBM DB2 UDB for iSeries .NET Provider
File version : 11.0.0.4
Assembly version : 10.0.0.0 V5R4M0

i think IBM created a different .NET data provider for DB2/400...

what do you think ?


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jun 23, 2006 7:23 am 
Regular
Regular

Joined: Thu May 11, 2006 12:30 pm
Posts: 72
i made these changes and all works...

public DB2Driver() : base (
"IBM.Data.DB2.iSeries",
"IBM.Data.DB2.iSeries.iDB2Connection",
"IBM.Data.DB2.iSeries.iDB2Command")
{
}

i could create a new driver for DB2 on OS/400, what do you think ?


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jun 23, 2006 8:37 am 
Contributor
Contributor

Joined: Wed May 11, 2005 4:59 pm
Posts: 1766
Location: Prague, Czech Republic
Yes, creating a new driver is a good idea.


Top
 Profile  
 
 Post subject: For DB2.Driver does this change incorporated?
PostPosted: Thu Aug 02, 2007 6:48 am 
Newbie

Joined: Mon Jul 16, 2007 9:35 am
Posts: 17
I am trying to connect DB2 from my .NET application using NHibernate.
I read this and I want to know whether NHibernate Source is been updated and distributed.

In the latest NHiberbate.dll(1.2.0) does this Change refelected? Because I am unable to use this "NHibernate.Driver.DB2Driver'' dll. For me it is not connecting to the DB2 Database(verison 8.1) and it throws error. This driver is not supported.

Can you tell whether the suggestions have been implemented? R we have to do manually to connect to this DB2.

Thanks for your time,
Cheers
Sudhagar.s


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 7 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.