INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Jobs

Mimer Data Provider mono

Mimer Data Provider mono

(OP)
has anyone had any luck connecting to Mimer using mono and the Mimer Data Provider. I'm trying to connect to a Mimer Db running version 9.2.3a, and I have tried running the following code on mono 1.1.8, and 1.1.13 (current version) with the same result

using Mimer.Data.Client;

public class MainClass
{        
    public static void Main(String[] args)
    {
       MimerConnection conn;                                    
           
       String ConnectionString = "Database=***;Node=***;Protocol=tcp;Service=1360;User ID=****;Password=****";       
       
       conn = new MimerConnection(ConnectionString);                     
       try
       {
           conn.Open();           
           conn.Close();
       }
       catch (Exception ex)
       {              
              Console.WriteLine(ex.Message);
              Console.WriteLine(ex.StackTrace);                   
       }       
    }
}

The exception message is always "The socket is not connected" and thrown in the MimerConnection.Open() method

I have pretty much the same code running on windows with Visual Studio .NET 2005, and it works fine.

RE: Mimer Data Provider mono

Hi,

On what platform are you running? I have tried Mono and Mimer on both Linux and Windows without problems. If you are running on Linux, make sure the Mimer TCP server is started. This is done via xinetd. If it is a new installation you might have to restart xinetd. If you have Java installed you can also use the Mimer JDBC Driver directly to make sure the TCP Server responds: java -cp <path_to_mimer>/lib/mimjdbc3.jar com.mimer.jdbc.Driver -ping jdbc:mimer://username:passwd@hostname/databasename. On Windows, the Mimer JDBC Driver is located directly in the Mimer SQL installation directory.

/Fredrik

RE: Mimer Data Provider mono

(OP)
The Database Server is running on Linux (RHEL), and I know the TCP server is started because I can connect to the database with my .NET Program on Windows, and I can connect to it using DBvisualizer, query builder .. etc...

I copied the exact code in my first post to a .NET project on windows, and was able to connect.

I don't have sysadm on the server I 'm trying to connect to so
I installed a copy of Mimer on my local Windows machine, and created a database using Mimer Administrator.  I can connect to that DB with .NET and Mimer Data Provider, DBVisualizer , using odbc, but I get that same socket error when attempting to connect with mono and the Mimer Data Provider.

I'm using Ubuntu (breezy) as my linux machine, and have tried using the mono packages that come with breezy, and a third party repo that had the bleeding edge mono packages.

I think I'll try installing mono on my windows machine, and see if I have any luck running the code on there.

RE: Mimer Data Provider mono

(OP)
I installed Mono on my windows machine. The newest version (1.1.13-2) and had no problems copying my exact code over and connecting to the database.  So I copied the System.dll that mono installs on windows over to my ubuntu machine and then referenced it instead of the System.ddl in the global Assembly. Still no luck, it threw a exception.

An exception was thrown by the type initializer for System.Net.Dns

So it works with mono on windows, but I still can connect using mono on Linux.

The packages I used to install mono on my ubuntu machine has the same version listed as what you can download on mono's website.  

RE: Mimer Data Provider mono

(OP)
Still trying to get this working on ubuntu. Reading the release notes for the Mimer Data Provider (mono version) it says it has been tested with Mono 1.06 and 1.1.4. I'v got a connection to the database running on Windows with Mono 1.1.13-2, but on Linux no luck with that version. So I pulled down version 1.1.4 and installed in /usr/local/mono-old-version so not to interfer with my version installed from the ubuntu repo. Compiling and running my program with 1.1.4 gives me the same result.

The socket is not connected
in <0x00051> System.Net.Sockets.Socket:Shutdown (System.Net.Sockets.SocketShutdown)
in <0x00022> Mimer.Data.Client.MimerTcp:Close ()
in <0x003c8> Mimer.Data.Client.MimerConnection:Open ()
in <0x00038> (wrapper remoting-invoke-with-check) Mimer.Data.Client.MimerConnection:Open ()
in <0x0003f> MainClass:Main (string[])

Same code that gives me this error on linux works on Windows.

RE: Mimer Data Provider mono

I was just about to try it out on Windows with the latest Mono  release, but that's no point in that then. I will try it on Linux instead. I'm afraid I don't have access to a Ubuntu machine, I will try it on SuSE (Open Suse 10). I'll let you know the result. It sounds like a network problem to me.

RE: Mimer Data Provider mono

Now I have tried this on Open Suse 10.9 running Mono 1.0.8, and it does look like you are having a network problem or that the Mimer TCP server is not started after all. The Mimer TCP server is started through xinetd so you have to start that (/etc/rc.d/xinetd start). If it is a new installation you have to restart xinetd (/etc/rc.d/xinetd restart). Also, make sure you have a mimer entry in /etc/xinetd.d.

Without the Mimer TCP server (through xinetd) started I get the following error:
Error connecting to database multi1 on node kalimero.mimer.se using protocol tcp to service 1360
in <0x001af> Mimer.Data.Client.MimerTcp:Open (System.String database, System.String node, System.String protocol, System.String service, Int32 timeout)
in <0x0017e> Mimer.Data.Client.MimerConnection:Open ()
in (wrapper remoting-invoke-with-check) Mimer.Data.Client.MimerConnection:Open ()
in <0x0003f> MainClass:Main (System.String[] args)


After starting the Mimer TCP server with "/etc/rc.d/xinetd start" I can connect succesfully. I'm running exactly the same code as you, except I have added the following import at the top to make it compile:

using Mimer.Data.Client;
using System;

I'm not sure about you configuration. Are you running both Mono and Mimer SQL on the same Linux (Ubuntu) machine, or are you trying to connect the Mimer SQL instance running on the Windows machine? Do you have any firewall in between? For example, if you are running Windows XP with SP2 the built in firewall will block TCP connections on port 1360 (used by Mimer SQL). Try to disable the firewall for a second, or open the 1360 TCP port. Or do you have a firewall on the Linux machine that blocks outgoing connections?

Try to use the JDBC driver I described earlier from the same machine (Ubuntu) and ping the same database as you are trying to connect to from Mono.
On a local machine, using DbVisualizer with ODBC does not say much about this problem since ODBC does not use TCP to communicate with a local Mimer SQL database.

Regards,
Fredrik

RE: Mimer Data Provider mono

(OP)
I'm trying to connect to a Mimer Database running on Red Hat Enterprise Linux. I can connect to the database using bsql and odbc from the command line on my ubuntu machine, and I can connect to it using Dbvisualizer and the jdbc driver on my ubuntu machine, and I can connect using a Windows machine running mono, but not mono under ubuntu. Still have that socket error. Thanks for the reply back, I forgot I had this thread going.  The tcp server is started and working correctly.

I installed the newest mimer database on my windows machine, turned off all firewall settings, and connected fine with a C# application using mono, but running on linux gave me the same error.

I don't think it is a networking problem, I know the tcp server is started, and I would not be able to connect to the db on my windows machine if the tcp server was not started.

I turned networking off on my linux machine, and running my application under mono. This is the error I get.

Error connecting to database mydb on node ******* using protocol tcp to service 1360
in <0x001cf> Mimer.Data.Client.MimerTcp:Open (System.String database, System.String node, System.String protocol, System.String service, Int32 timeout)
in <0x00199> Mimer.Data.Client.MimerConnection:Open ()
in (wrapper remoting-invoke-with-check) Mimer.Data.Client.MimerConnection:Open ()
in [0x0000e] (at /home/met/workspace/code-repo/ucs_met/mimer_example/Main.cs:18) MainClass:Main (System.String[] args)

Turning networking back on, results in the following error when I run my application

The socket is not connected
in <0x0008d> System.Net.Sockets.Socket:Shutdown (SocketShutdown how)
in <0x00022> Mimer.Data.Client.MimerTcp:Close ()
in <0x003e6> Mimer.Data.Client.MimerConnection:Open ()
in (wrapper remoting-invoke-with-check) Mimer.Data.Client.MimerConnection:Open ()
in [0x0000e] (at /home/met/workspace/code-repo/ucs_met/mimer_example/Main.cs:18) MainClass:Main (System.String[] args)

Running the jdbc command you mentioned earlier results in the following output

ucs_bmt@ab1-1-7blushingtmp$ java -cp mimjdbc3.jar com.mimer.jdbc.Driver -ping jdbc:mimer://****:*****@*****/mydb
Database connection established.
getDatabaseProductName():    Mimer SQL Engine
getDatabaseProductVersion(): 09.02.0004 Mimer SQL Engine 9.2.4

Ping tests:
  0     0 ms
  1     1 ms
  2     0 ms
  3     1 ms
  4     1 ms
  5     0 ms
  6     0 ms
  7     1 ms
  8     0 ms
  9     0 ms
avg     0 ms      min     0 ms      max     1 ms


Have not had much time to try and get this working lately, but when I do I will post back. Thx

RE: Mimer Data Provider mono

I misunderstod your configuration a bit, I assumed you where running both the .NET-application and the Mimer SQL Server on the same (Ubuntu machine). I will look into this a bit further and let you know.

RE: Mimer Data Provider mono

I have tried this on a Ubuntu Linux machine now, both with a local database and a remote database, and I cannot get it to fail. I will take another look later on, but right now I canot get the error you are getting.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Resources

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close