Ross Boylan wrote:
Can anyone suggest how to avoid the following? Feel free to consider this a bug report, if it is a bug.
2000-01-16T04:38:30 PANIC(300) ZODB A storage error occurred in the last phase o f a two-phase commit. This shouldn't happen. The application may be in a hosed state, so we will not allow transactions to commit from here on
Was some sort of traceback displayed to go with this? The only time I've seen this is when running out of space.
This happens after some seemingly successful database activity. I believe the error is triggered by the commit before returning to the browser. I suspect I have opened a connection in a way that conflicts with the existing one.
I say, in some code which a form calls, conn = Globals.DB.open() root = conn.root() _my_Dir = root.get("OrgUser", None) if _my_Dir : print "Found directory" else: print "Creating directory" root["OrgUser"] = OrgUserDirectory() #subclass of PersistentMapping _my_Dir = root["OrgUser"] I then add an object to _my_dir, using dictionary protocols.
This is incomplete. I see nothing so far to indicate a problem, but I don't see what else you've done. Why do you open a new connection? If you just want to get the root object, you can get the root object for the connection of some existing persistent object with: anExistingPersistentObject._p_jar.root() The attribute '_p_jar' is the database connection for a persistent object. If you open a new connection, you need to make sure you close it.
The zope session is started with -D. running Zope 2.1.1 on win32.
It may also be relevant that my function returns a plain string to the browser.
Nah. Jim -- Jim Fulton mailto:jim@digicool.com Python Powered! Technical Director (888) 344-4332 http://www.python.org Digital Creations http://www.digicool.com http://www.zope.org Under US Code Title 47, Sec.227(b)(1)(C), Sec.227(a)(2)(B) This email address may not be added to any commercial mail list with out my permission. Violation of my privacy with advertising or SPAM will result in a suit for a MINIMUM of $500 damages/incident, $1500 for repeats.