On Friday, November 26, 2010 12:19:07 pm Ed Leafe wrote:
> On Nov 26, 2010, at 2:26 PM, Jacek Kałucki wrote:
> > As you know, psycopg2 uses implicit transactions.
> > Unfortunately, it causes that once per hundred writes
> > I loose my my data.
> > Here is the excerpt from backend log: http://dabo.codepad.org/ICZonfLB
> > There is warning message "there is no transaction in progress" after
> > second commit and my data flies away occasionally.
> > Is this possible that you add explicit transactions support
> > to PostgreSQL backend?
> 
>       I believe that issuing a second 'BEGIN' will not harm anything, although
> it may generate a warning. Can you try changing the beginTransaction
> method in dbPostgreSQL.py to issue:
> 
> cursor.execute("BEGIN")
> 
> ... and let me know how that works?
> 
> 
> 
> -- Ed Leafe

You can turn off implicit transactions!

Ed's work around I believe will work.  However, that is not the only issue 
involved.  If you consider that when a connection is created the query status 
is "IDLE".  However, after issuing a select statement the query status moves 
from "IDLE" to 'IDLE in transaction' and just stays there until the apps is 
closed.  So adding a 'begin' without turning off implicit may add more 'IDLE 
in transaction's.  

I'm sure there are other issues but they don't come to mind.  

Ed, does the framework issue a begin when only issuing a read (select) and 
then issue a commit after the read?

Johnf

_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-dev
Searchable Archives: http://leafe.com/archives/search/dabo-dev
This message: 
http://leafe.com/archives/byMID/[email protected]

Reply via email to