8 messages in com.mysql.lists.dotnetRE: Out of net
FromSent OnAttachments
Jorge Bastos03 Mar 2006 09:05 
Jorge Bastos03 Mar 2006 09:09 
Darren Hill03 Mar 2006 09:12 
Jorge Bastos03 Mar 2006 09:23 
SGr...@unimin.com03 Mar 2006 10:22 
Darren Hill03 Mar 2006 13:02 
Joshua Kugler03 Mar 2006 13:36 
Blue Wave Software05 Mar 2006 01:46 
Subject:RE: Out of net
From:Blue Wave Software (mys@bluewavesoftware.com.au)
Date:03/05/2006 01:46:25 AM
List:com.mysql.lists.dotnet

I have had similar problems caused by Firewall software. The MYSQL server Had a firewall program that decided that a lot of calls to the server was a threat and shut down the connection for several minutes.

This was temporally fixed by shutting down the fire wall software, and then latter setting up the firewall with rules to allow MYSQL traffic. Later testing found my creating a Connection object , opening it and then passing the open connection to the command object when creating it seemed to remedy the issue. It seems to be caused by using a closed connection and having the connection continually opened and closed.

I quite successfully use a generic data connection (data.idbdataconnection) assigning it to a provider at run time. Use it to crate data and command objects and open connection prior to a series of commands.

Because our data programs can use multiple data sources eg. MySQL, MSSQL, access ... I create the dataconnection in a generic DLL which them passes out a dataconnection of the correct type here is some sample code .

Function GetDataConnection(ConnectionType as Integer,ConnectionString as String)as IDBDataConnection

Select Case ConnectionType Case 1 Dim MYSQL as New MYSQLConnection ... set up connection return MYSQL Case 2 Dim ODBC as new Data.ODBCConnection ... set up connection return ODBC End Select

End Function

I then create what ever data object I need and use the System wide Data Connection then the code all flows nicely.

'Open Data Connection IF DBDataConnection.State = CLOSED then DBDataConnection.Open END IF

.... Process Data

DBDataConnection.Close

Hope it helps some one.

Regards, Justin Elward

Blue Wave Software Pty Limited jus@bluewavesoftware.com.au

Ph. +61 2 4320 6090 (Central Coast - Office) Ph. +61 2 4915 7064 (Newcastle) Ph. +61 2 8208 5982 (Sydney)

Fx. +61 2 4320 6092

----------------------------------------------------------------------------

------------------- DISCLAIMER: This message is proprietary to Blue Wave Software Pty Limited (BWS) and is intended solely for the use of the individual or individuals to whom it is addressed. It may contain privileged or confidential information and should not be circulated with out informing BWS prior or used for any purpose other than for what it is intended. If you have received this message in error, please notify the originator immediately. If you are not the intended recipient, you are notified that you are strictly prohibited from using, copying, altering, or disclosing the contents of this message. BWS accepts no responsibility (except where required under Australian law) for loss or damage arising from the use or misuse of the information transmitted by this email including damage from virus."

----------------------------------------------------------------------------

-------------------

-----Original Message----- From: Joshua Kugler [mailto:josh@uaf.edu] Sent: Saturday, 4 March 2006 8:37 AM To: dot@lists.mysql.com Cc: Jorge Bastos Subject: Re: Out of net

On Friday 03 March 2006 08:05, Jorge Bastos wrote:

DecimalPeople,

I'm doing a loop with 5000 records, and inside this loop i'm updating another table depending on a value on the first table, as i will show below:

dim dt as new datatable dt=sqldatatable("select * from table_name")

for i as int32=0 to dt.rows.count-1 sql="update other_table set fields='" & dt.rows(i)("value") & "' insert_sql(sql) next

I'm not terribly familiar with Connector.net, but I have used it some. I'd be curious as to the contents of your insert_sql() function. Does it make a new connection for every insert? Windows has a funny thing in that when it allocates a socket, it will "hold" it for a little while after it is released, thus you can use up all your sockets. If you are doing a connect/disconnect for every insert_sql() call, that could very well be your problem. Try passing the connection object to insert_sql() instead of opening a new connection in that function.

If you *don't* open a new connection for every insert, then I'm at a loss. :)

j----- k-----

In about the 2500 record +- i just get out of network and got the error below:

************** Exception Text ************** System.Net.Sockets.SocketException: A request to send or receive data was disallowed because the socket is not connected and (when sending on a datagram socket using a sendto call) no address was supplied at System.Net.Sockets.Socket.Shutdown(SocketShutdown how) at MySql.Data.Common.SocketStream.Read(Byte[] buffer, Int32 offset, Int32 count) at System.IO.BufferedStream.ReadByte() at MySql.Data.MySqlClient.PacketReader.ReadHeader() at MySql.Data.MySqlClient.PacketReader.OpenPacket() at MySql.Data.MySqlClient.NativeDriver.Open() at MySql.Data.MySqlClient.MySqlConnection.Open()

I'm now saying that is the driver problem. After this, i've noticed that i only can't connect to the mysql server, i just can't connect to no remote machine, completly without network, not even a ping works. I just wait about 1 minute and it starts to work again.

My Question is, why does this happens? if there any option for the connection string to solve this, doing some fine tunning?

Another question, isn't going to be out no more versions of the driver?