/[projects]/dao/DaoMqPump2/DaoMqPump2/Transport.cs
ViewVC logotype

Diff of /dao/DaoMqPump2/DaoMqPump2/Transport.cs

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 2009 by torben, Mon Jul 8 14:49:31 2013 UTC revision 2010 by torben, Wed Jul 10 18:28:31 2013 UTC
# Line 153  namespace DaoMqPump2 Line 153  namespace DaoMqPump2
153    
154                  //stage 2 connect to mysql                  //stage 2 connect to mysql
155                  string mysqlString = buildMysqlConnString();                  string mysqlString = buildMysqlConnString();
156                  MySqlConnection sqlConnection = new MySqlConnection(mysqlString);                  MySqlConnection sqlReadConnection = new MySqlConnection(mysqlString);
157                  sqlConnection.Open();                  sqlReadConnection.Open();
158    
159                    MySqlConnection sqlWriteConnection = new MySqlConnection(mysqlString);
160                    sqlWriteConnection.Open();
161    
162    
163                  //stage 3 move messages                  //stage 3 move messages
164                  string readSql = "CALL " + sql2mqReadQuery + "()";                  string readSql = "CALL " + sql2mqReadQuery + "()";
165                  MySqlCommand readCmd = new MySqlCommand(readSql, sqlConnection);                  MySqlCommand readCmd = new MySqlCommand(readSql, sqlReadConnection);
166                  MySqlDataReader dataReader = readCmd.ExecuteReader();                  MySqlDataReader dataReader = readCmd.ExecuteReader();
167                  while (dataReader.Read())                  while (dataReader.Read())
168                  {                  {
# Line 179  namespace DaoMqPump2 Line 182  namespace DaoMqPump2
182                      //now that the message has been put on queue mark it as such                      //now that the message has been put on queue mark it as such
183    
184                      string updateSql = "CALL " + sql2mqUpdateQuery + "(" + id + ")";                      string updateSql = "CALL " + sql2mqUpdateQuery + "(" + id + ")";
185                      MySqlCommand updateCmd = new MySqlCommand(updateSql, sqlConnection);                      MySqlCommand updateCmd = new MySqlCommand(updateSql, sqlWriteConnection);
186                      int numrows = updateCmd.ExecuteNonQuery();                      int numrows = updateCmd.ExecuteNonQuery();
187    
188                      translog.WriteLine(getNowString() + " " + msgString + "\n");                      translog.WriteLine(getNowString() + " " + msgString + "\n");
# Line 196  namespace DaoMqPump2 Line 199  namespace DaoMqPump2
199                  dataReader.Close();                  dataReader.Close();
200                  out_queue.Close();                  out_queue.Close();
201                  mqMgr.Close();                  mqMgr.Close();
202                  sqlConnection.Close();                  sqlReadConnection.Close();
203                    sqlWriteConnection.Close();
204              }              }
205              catch (Exception e)              catch (Exception e)
206              {              {

Legend:
Removed from v.2009  
changed lines
  Added in v.2010

  ViewVC Help
Powered by ViewVC 1.1.20