-->
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.  [ 5 posts ] 
Author Message
 Post subject: cannot connect to firebird!
PostPosted: Thu Oct 26, 2006 6:29 am 
Newbie

Joined: Thu Oct 19, 2006 10:11 am
Posts: 5
Hello all you kick a** developers!

I am fairly new to NHibernate and I have .... a lot of problems right now! I can't get my app to connec to a firebird server!
For the moment the error message is:
Code:
Could not create the driver from NHibernate.Driver.FirebirdDriver


I am using Visual Studio (c++) 2005



Hibernate version:
1.2.0beta1


Full stack trace of any exception that occurs:
" vid NHibernate.Connection.ConnectionProvider.ConfigureDriver(IDictionary settings)\r\n vid NHibernate.Connection.UserSuppliedConnectionProvider.Configure(IDictionary settings)\r\n vid NHibernate.Connection.ConnectionProviderFactory.NewConnectionProvider(IDictionary settings)\r\n vid NHibernate.Cfg.SettingsFactory.BuildSettings(IDictionary properties)\r\n vid NHibernate.Cfg.Configuration.BuildSettings()\r\n vid NHibernate.Cfg.Configuration.BuildSessionFactory()\r\n vid nHibernate.MainForm.button1_Click(Object sender, EventArgs e) i c:\\source\\nhibernate\\nhibernate\\mainform.h:rad 103\r\n vid System.Windows.Forms.Control.OnClick(EventArgs e)\r\n vid System.Windows.Forms.Button.OnClick(EventArgs e)\r\n vid System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)\r\n vid System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)\r\n vid System.Windows.Forms.Control.WndProc(Message& m)\r\n vid System.Windows.Forms.ButtonBase.WndProc(Message& m)\r\n vid System.Windows.Forms.Button.WndProc(Message& m)\r\n vid System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)\r\n vid System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)\r\n vid System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)\r\n vid System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)\r\n vid System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(Int32 dwComponentID, Int32 reason, Int32 pvLoopData)\r\n vid System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)\r\n vid System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)\r\n vid System.Windows.Forms.Application.Run(Form mainForm)\r\n vid main(String[] args) i c:\\source\\nhibernate\\nhibernate\\nhibernate.cpp:rad 16"



Name and version of the database you are using:
Firebird 1.5.0


my app.config (named nHibernate.exe.config)

Code:
<?xml version="1.0" encoding="utf-8" ?>
<configuration>

  <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.cache.provider_class"
         value="NHibernate.Cache.HashtableCacheProvider, NHibernate"
  />
    <add
         key="hibernate.cache.use_query_cache"
         value="true"
  />

    <add
         key="hibernate.bytecode.provider"
         value="lcg"
  />

    <add
         key="hibernate.prepare_sql"
         value="false"
         />

    <!--
         The valid strings for Isolation can be found in the documentation for the System.Data.IsolationLevel
         Enumeration documentation.  Use the member names - not the values.
      -->
    <!-- -->
    <add
         key="hibernate.connection.isolation"
         value="ReadCommitted"
  />

 

    <!-- This is the Firebird configuration -->
    <!-- -->
    <add
         key="hibernate.dialect"                           
         value="NHibernate.Dialect.FirebirdDialect"
      />
    <add
         key="hibernate.connection.driver_class"               
         value="NHibernate.Driver.FirebirdDriver"
      />
    <add
         key="hibernate.connection.connection_string"
         value="Server=localhost;Database=c:\\source\\hibernate_test.fdb;User=SYSDBA;password=masterkey;ServerType=1;Pooling=false"
      />
    <add
         key="hibernate.query.substitutions"
         value="true 1, false 0"
      />
    <!-- -->


  </nhibernate>

  <!-- This section contains the log4net configuration settings -->
  <log4net debug="false">

    <!-- Define some output appenders -->
    <appender name="trace"
              type="log4net.Appender.TraceAppender, log4net">
      <layout type="log4net.Layout.PatternLayout,log4net">
        <param name="ConversionPattern"
                  value="%d [%t] %-5p %c - %m%n" />
      </layout>
    </appender>

    <appender name="console"
              type="log4net.Appender.ConsoleAppender, log4net">
      <layout type="log4net.Layout.PatternLayout,log4net">
        <param name="ConversionPattern"
                  value="%d [%t] %-5p %c - %m%n" />
      </layout>
    </appender>

    <appender name="rollingFile"
              type="log4net.Appender.RollingFileAppender,log4net" >

      <param name="File"
               value="log.txt" />
      <param name="AppendToFile"
               value="false" />
      <param name="RollingStyle"
               value="Date" />
      <param name="DatePattern"
               value="yyyy.MM.dd" />
      <param name="StaticLogFileName"
               value="true" />

      <layout type="log4net.Layout.PatternLayout,log4net">
        <param name="ConversionPattern"
                  value="%d [%t] %-5p %c - %m%n" />
      </layout>
    </appender>

    <!-- Setup the root category, add the appenders and set the default priority -->

    <root>
      <priority value="INFO" />
      <appender-ref ref="console" />
    </root>

    <logger name="NHibernate.Bytecode.CodeDom">
      <priority value="OFF" />
    </logger>

    <logger name="NHibernate.SQL">
      <level value="DEBUG" />
    </logger>
  </log4net>
 
</configuration>





Thanks!


Top
 Profile  
 
 Post subject:
PostPosted: Thu Oct 26, 2006 7:11 am 
Beginner
Beginner

Joined: Wed Mar 22, 2006 6:59 am
Posts: 30
Hi, here is how i configure my session to get connected to Firebird Server:

Code:
        static NHibernateSessionFactory()
        {
            cfg = new NHibernate.Cfg.Configuration();

            cfg.Properties.Add(NHibernate.Cfg.Environment.ConnectionProvider,"NHibernate.Connection.DriverConnectionProvider");
            cfg.Properties.Add(NHibernate.Cfg.Environment.ConnectionDriver, "NHibernate.Driver.FirebirdClientDriver");
            cfg.Properties.Add(NHibernate.Cfg.Environment.Dialect, "NHibernate.Dialect.FirebirdDialect");

           
            cfg.Properties.Add(NHibernate.Cfg.Environment.MaxFetchDepth, "3");

                        //Server=localhost;User=SYSDBA;Password=masterkey;Database=Gi2007
            cfg.Properties.Add(NHibernate.Cfg.Environment.ConnectionString,
                "Server=" + Properties.Settings.Default.Servidor + ";" +
                "Port=" + Properties.Settings.Default.Porta + ";" +
                "User=" + Properties.Settings.Default.Usuario + ";" +
                "Password=" + Properties.Settings.Default.Senha + ";" +
                "Database=" + Properties.Settings.Default.Banco);

           
            cfg.AddAssembly(Assembly.LoadFrom("giModel.dll"));

            sessionFactory = cfg.BuildSessionFactory();

        }


Now here some points:

I recomend you to use Firebird ADO.NET provider 2.0.
You must add reference Firebird provider into you project... and everything will be fine.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Oct 31, 2006 4:56 am 
Newbie

Joined: Thu Oct 19, 2006 10:11 am
Posts: 5
I am confused! This code doesn't run at all if I *don't* remove the line:

cfg.Properties.Add(NHibernate.Cfg.Environment.ConnectionDriver, "NHibernate.Driver.FirebirdClientDriver");

isn't that strange?


Anyway, I got a new problem which I present
here!


Top
 Profile  
 
 Post subject:
PostPosted: Tue Oct 31, 2006 6:58 am 
Beginner
Beginner

Joined: Wed Mar 22, 2006 6:59 am
Posts: 30
Hi mackey,

you must install this Firebird .net provider:

http://prdownloads.sourceforge.net/fire ... e?download

in order to make the following sentence work:

Code:
cfg.Properties.Add(NHibernate.Cfg.Environment.ConnectionDriver, "NHibernate.Driver.FirebirdClientDriver");


and also, you must add reference do firebird .net provider assembly.

bye...


Top
 Profile  
 
 Post subject:
PostPosted: Tue Oct 31, 2006 7:06 am 
Newbie

Joined: Thu Oct 19, 2006 10:11 am
Posts: 5
aaaah, stupid of me... the wrong version installed... Thanks


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 5 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.