<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Hello,<br>
did you do the commit on the other connection (USER one) as well?
According to my understanding on typical transaction separation you
should do commits on BOTH connections after modifying data in one of
them if you want to see the new data in other. Basically with
transactional databases you will see the data as it was first time you
select it from calling session (or the way you modified it from calling
session), while other sessions are completely isolated and their data
wont get to you even if they perform a commit.<br>
<br>
Jekabs<br>
<br>
S. D. Rose wrote:
<blockquote cite="middv786d$6bf$1@sea.gmane.org" type="cite">
  <pre wrap="">I've found the .change_user() function on the connection, that seems to work
fine.

-Dave
"S. D. Rose" <a class="moz-txt-link-rfc2396E" href="mailto:s_david_rose@hotmail.com">&lt;s_david_rose@hotmail.com&gt;</a> wrote in message
<a class="moz-txt-link-freetext" href="news:dv6s4e$nba$1@sea.gmane.org">news:dv6s4e$nba$1@sea.gmane.org</a>...
  </pre>
  <blockquote type="cite">
    <pre wrap="">Hello all.
  I have a python program which reads configs from a MySQL database.
    </pre>
  </blockquote>
  <pre wrap=""><!---->There
  </pre>
  <blockquote type="cite">
    <pre wrap="">are 2 user accounts, USER and MANAGER.    There are 2 catalogs, DATA and
CONFIG.

  I thought I was real savvy -- I created two connections to the database,
    </pre>
  </blockquote>
  <pre wrap=""><!---->a
  </pre>
  <blockquote type="cite">
    <pre wrap="">cursor = conn.cursor() and a privCursor = privConn.cursor(), where
conn.cursor() is connected with USER and privConn.cursor() is connected
    </pre>
  </blockquote>
  <pre wrap=""><!---->with
  </pre>
  <blockquote type="cite">
    <pre wrap="">MANAGER, thus when a config. change is required, a login box pops up, I
login with MANAGER, do the change, then close the login box.  I thought
    </pre>
  </blockquote>
  <pre wrap=""><!---->that
  </pre>
  <blockquote type="cite">
    <pre wrap="">would allow me to then view-only at any time, and modify with a password.

  My problem is that after I modify the config fields of the CONFIG
    </pre>
  </blockquote>
  <pre wrap=""><!---->catalog
  </pre>
  <blockquote type="cite">
    <pre wrap="">with MANAGER, then scan them with USER (So I can re-populate my combo-box
with updated info) I always get the old data from a .fetchall().  I've
    </pre>
  </blockquote>
  <pre wrap=""><!---->done
  </pre>
  <blockquote type="cite">
    <pre wrap="">a .commit() after my:
.execute(""" DELETE FROM configuredcameras""")
.commit()
.executemany(""" INSERT INTO configuredcameras (IPaddress) VALUES (%s)
    </pre>
  </blockquote>
  <pre wrap=""><!---->""",
  </pre>
  <blockquote type="cite">
    <pre wrap="">(self.cameraList_combo_box.GetStrings() )
.commit()

I've also done a time.sleep(1) just to make sure I wasn't querying the
database too quickly, but still I get the old data.  however, if I close
    </pre>
  </blockquote>
  <pre wrap=""><!---->the
  </pre>
  <blockquote type="cite">
    <pre wrap="">program and re-start, I get the data upon initializing the program.

Also, using the Graphical Query tool from the MySQL site right after I do
this DELETE / INSERT INTO, I see the data in the table.

I just don't get it!

Ahh, but if I create a 'new' connection to the database as 'USER', I can
    </pre>
  </blockquote>
  <pre wrap=""><!---->see
  </pre>
  <blockquote type="cite">
    <pre wrap="">the data right after inserting it.
Can I 'Refresh' the USER connection I made to the database BEFORE I had
logged into the database as MANAGER?  Or, do I have to close the MANAGER
connection and re-connect via USER?

Any help is greatly appreciated!!
Dave



_______________________________________________
DB-SIG maillist  -  <a class="moz-txt-link-abbreviated" href="mailto:DB-SIG@python.org">DB-SIG@python.org</a>
<a class="moz-txt-link-freetext" href="http://mail.python.org/mailman/listinfo/db-sig">http://mail.python.org/mailman/listinfo/db-sig</a>

    </pre>
  </blockquote>
  <pre wrap=""><!---->


_______________________________________________
DB-SIG maillist  -  <a class="moz-txt-link-abbreviated" href="mailto:DB-SIG@python.org">DB-SIG@python.org</a>
<a class="moz-txt-link-freetext" href="http://mail.python.org/mailman/listinfo/db-sig">http://mail.python.org/mailman/listinfo/db-sig</a>
  </pre>
</blockquote>
<br>
</body>
</html>