Hi,
Having only ever heard of AS400 and never having used AS400 I have recently been tasked with getting our NHibernate application to talk to DB2 running on an AS400 (running version V4R3). Looking at some of the earlier posts here it looks like I am in for a lot of fun.
I have the following NHibernate configuration (with the correct details filled in in the connection string) :-
<session-factory>
<property name="connection.provider">NHibernate.Connection.DriverConnectionProvider</property>
<property name="dialect">NHibernate.Dialect.DB2400Dialect</property>
<property name="connection.driver_class">NHibernate.Driver.DB2400Driver</property>
<property name="connection.connection_string">Server=192.168.96.XX;UID=ENTERUIDHERE;PWD=ENTERPWDHERE;DATABASE=ENTERDATABASEHERE</property>-->
<property name="proxyfactory.factory_class">NHibernate.ByteCode.Castle.ProxyFactoryFactory, NHibernate.ByteCode.Castle</property>
<property name="command_timeout">15000</property>
<property name="current_session_context_class">thread_static</property>
</session-factory>
and I thought I would start off simple by trying to create a schema using the following code :-
private void CreateSchemaClick(object sender, RoutedEventArgs e)
{
var cfg = new Configuration();
cfg.Configure("hibernate.cfg.xml");
cfg.AddAssembly(Assembly.GetCallingAssembly());
new SchemaExport(cfg).Execute(false, true, false);
MessageBox.Show("Successfully created schema");
}
However, when the code is run I get the following error returned to Visual Studio :-
ERROR [08001]
[IBM] SQL30081N A communication error has been detected. Communication protocol
being used: "TCP/IP". Communication API being used: "SOCKETS". Location where
the error was detected: "192.168.96.XX". Communication function detecting the
error: "connect". Protocol specific error code(s): "10061", "*", "*".
SQLSTATE=08001
My instincts tell me that is a connection error caused due to the fact that the AS400 has no servers listening for connections on TCPIP. However, that is only a guess. I was wondering if anyone has any clues on what I need to do to get this to work.
Kind regards
Alex