[Zope-DB] DCOracle2 and multiple SQl statements

Dieter Maurer dieter@handshake.de
Wed, 30 Jan 2002 21:27:25 +0100


Smith, Neil writes:
 > Matthew T. Kromer  wrote:
 > 
 > >Thats what is supposed to happen, yes.  Unless you call something that 
 > >explicitly does a commit() there shouldn't be any problem with issuing 
 > >multiple statements in the same transaction.
 > 
 > I don't do any commits.  Maybe it is the way that things are being called.
 > 
 > I have a dtml-method that displays a form and it calls the sql method like
 > this:
 > 
 >     <dtml-if expr="submit=='Update'">
 >         <dtml-try>
 >             <dtml-call "MasterDetailUpdateMethod(REQUEST)">
 >             Your data was updated!
 >             <dtml-var back_button>
 >         <dtml-except DatabaseError>
 >             ...error handling for recognised problems
By this exception handling, you take over full responsibility.

Raise another exception if you want the transaction to be aborted
or look at "emulateRedirect" on

  <http://www.dieter.handshake.de/pyprojects/zope>

If you do nothing special after you catched the exception,
Zope's transaction (and the one of your database) is commited.


Dieter