Solved

UPDATE MySql table simultaneously no possible?

Posted on 2009-05-05
8
1,200 Views
Last Modified: 2012-05-06
Hello,

why can I not make a sql UPDATE at the same time on a MySql table. Me and my colleague are updating the same table at the same time.

The below Exceptions are from me. My colleague gets the error message, that he can not read dataset.



05.05.2009 08:54:53|ERROR|MySqlException in Methode threadLoop, Message: Fatal error encountered during command execution., Number:0
05.05.2009 08:54:53|ERROR|Nicht behandelter Fehlercode, in MySql Dokumentation nachschauen, Message: Fatal error encountered during command execution., InnerException:MySql.Data.MySqlClient.MySqlException: Fatal error encountered attempting to read the resultset. ---> MySql.Data.MySqlClient.MySqlException: Reading from the stream has failed. ---> System.IO.IOException: Von der Übertragungsverbindung können keine Daten gelesen werden: Eine vorhandene Verbindung wurde vom Remotehost geschlossen. ---> System.Net.Sockets.SocketException: Eine vorhandene Verbindung wurde vom Remotehost geschlossen
   bei System.Net.Sockets.Socket.Receive(Byte[] buffer, Int32 offset, Int32 size, SocketFlags socketFlags)
   bei System.Net.Sockets.NetworkStream.Read(Byte[] buffer, Int32 offset, Int32 size)
   --- Ende der internen Ausnahmestapelüberwachung ---
   bei System.Net.Sockets.NetworkStream.Read(Byte[] buffer, Int32 offset, Int32 size)
   bei System.IO.BufferedStream.ReadByte()
   bei MySql.Data.MySqlClient.MySqlStream.LoadPacket()
   --- Ende der internen Ausnahmestapelüberwachung ---
   bei MySql.Data.MySqlClient.MySqlStream.LoadPacket()
   bei MySql.Data.MySqlClient.MySqlStream.ReadPacket()
   bei MySql.Data.MySqlClient.NativeDriver.ReadResult(UInt64& affectedRows, Int64& lastInsertId)
   bei MySql.Data.MySqlClient.MySqlDataReader.GetResultSet()
   bei MySql.Data.MySqlClient.MySqlDataReader.NextResult()
   --- Ende der internen Ausnahmestapelüberwachung ---
   bei MySql.Data.MySqlClient.MySqlDataReader.NextResult()
   bei MySql.Data.MySqlClient.MySqlCommand.ExecuteReader(CommandBehavior behavior)

Open in new window

0
Comment
Question by:MSFanboy
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 4
8 Comments
 
LVL 143

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 24303070
table structure? engine? indexes?
update/select statements?
0
 

Author Comment

by:MSFanboy
ID: 24304006
if you mean the storage engine I think its MyISAM. About the table structure I can not say anything due to company...
 private int disableArticle(string str_Artnr)
        {
            mycomm = mycon.CreateCommand(); 
            mycomm.CommandText = "UPDATE tablename SET bbactiv = 0 WHERE artnum = " + str_Artnr;            
            return mycomm.ExecuteNonQuery();
        }


0
 
LVL 143

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 24304542
does the field artnum have a index? is it the primary key?
0
Ransomware: The New Cyber Threat & How to Stop It

This infographic explains ransomware, type of malware that blocks access to your files or your systems and holds them hostage until a ransom is paid. It also examines the different types of ransomware and explains what you can do to thwart this sinister online threat.  

 

Author Comment

by:MSFanboy
ID: 24304626
No its not a Primary Key. It has varchar(255) AND set to "Not Null"
0
 
LVL 143

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 24304698
please ensure that field does have a index on it, eventually a primary key (at least it looks to me that it might be the primary key)
0
 

Author Comment

by:MSFanboy
ID: 24314580
artnum is my PK
0
 
LVL 143

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 24314639
then the optimization is ok, so far.

anything else needs deep investigations, like server settings (key_buffer_size, for example)
check if you have any logs in the mysql logs ...
0
 

Accepted Solution

by:
MSFanboy earned 0 total points
ID: 24329235
too bad we can not check the mysql logs because the database is a webshop database from a sort of rent webshop system :/ We can just programm against the database but we cant touch the server settings etc...
0

Featured Post

The Orion Papers

Are you interested in becoming an AWS Certified Solutions Architect?

Discover a new interactive way of training for the exam.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…

623 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question