From: Terry M. <ter...@ds...> - 2006-03-27 12:52:43
|
Hi, I don't now if I am implementing the DB-API via pypgsql properly but I have a web app that opens a db connection and a couple of cursors at application startup and I use the same cursors throughout the life of the app. Doing it this way I have noticed that transactions begin once a commit had been done. If an SQL statement acts on a table with a timestamp column using the now() function, as it is in a transaction the time used in the update/insert is when the transaction was started which means that after my last commit if a significant time has elapsed before the cursor is used again to update/insert a row the time stored is that of when the transaction began and not when the row was inserted which could easily be long after the transaction began. What is the best practice in using cursors and how do I get the timestamp to reflect when the row was created. Cheers in advance |