[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[gnue] r7721 - trunk/gnue-forms/src
From: |
reinhard |
Subject: |
[gnue] r7721 - trunk/gnue-forms/src |
Date: |
Tue, 12 Jul 2005 12:16:35 -0500 (CDT) |
Author: reinhard
Date: 2005-07-12 12:16:34 -0500 (Tue, 12 Jul 2005)
New Revision: 7721
Modified:
trunk/gnue-forms/src/GFForm.py
Log:
Fixed behaviour for exceptions happening during Connection.commit(). This
happens with appserver if an OnValidate trigger fails.
Do not call rollback any more on failed post; it is already handled on
GDataSource level.
Modified: trunk/gnue-forms/src/GFForm.py
===================================================================
--- trunk/gnue-forms/src/GFForm.py 2005-07-12 16:59:25 UTC (rev 7720)
+++ trunk/gnue-forms/src/GFForm.py 2005-07-12 17:16:34 UTC (rev 7721)
@@ -672,14 +672,18 @@
gDebug (5, "Trigger block Pre-Commit threw a AbortRequest!")
return _("Block trigger returned error")
- # Now do the real commit () on the backend connections (only once per
- # connection, if multiple blocks are sharing the same connection)
- for conn in self.__getConnections ().values ():
- conn.commit ()
+ try:
+ # Now do the real commit () on the backend connections (only once per
+ # connection, if multiple blocks are sharing the same connection)
+ for conn in self.__getConnections ().values ():
+ conn.commit ()
- # Make sure the block is in consistent state again
- for block in self._logic._blockList:
- block.finalizeCommit ()
+ finally:
+ # Make sure the block is in consistent state again; this has to be
+ # done in any case if the processCommit was successful, even if the
+ # connection commit failed - thus the "finally" here.
+ for block in self._logic._blockList:
+ block.finalizeCommit ()
# Execute Post-Commit-Trigger for each block
for block in self._logic._blockList:
@@ -696,7 +700,6 @@
self.processTrigger ('Post-Commit')
except DBError:
- self.rollback (1)
message = u_("Database commit error:\n%(exType)s\n%(exMessage)s") \
% {'exType' : sys.exc_info ()[0],
'exMessage': sys.exc_info ()[1]}
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [gnue] r7721 - trunk/gnue-forms/src,
reinhard <=