[Zope-DB] Are transactions/atomicity implicit in ZSQL+ Oracle ?

Renaud Guérin rguerin@free.fr
Thu, 21 Mar 2002 15:47:38 +0100 (MET)

En réponse à kapil thangavelu <kthangavelu@earthlink.net>:

> > > it would be much better to use a sequence. the above is only safe in
> a
> > > transaction serialized mode.
> > Unfortunately I can't modify the db structure or even add simple
> objects.
> > My question is precisely this: is there explicit LOCKing to do to
> ensure
> > serialization or does Zope do it automatically for all SQL statements
> in a
> > single ZSQL method?
> zope doesn't do any locking per say, it tries to handle transaction 
> integration to make all methods invoked during a request happen 
> transactionally.

> > If the Oracle DA supports transactions, which I guess it does, am I
> right
> > to assume that the 2 SQL statements inside my ZSQL method are an
> atomic
> > operation ?
> you can assume transactionality. zope's transaction boundary is at the
> end of 
> an http request where it will attempt to commit to all db adapters
> involved 
> during a request. which means all zsql methods involved in a http
> request are 
> associated with a single transaction. of course this is not true if you
> are 
> manually manipulating the transaction.
> atomicity, depends on what you're doing and how you've set up the
> database 
> connection/env, specifically its transaction isolation level.  

I'm not in control of the Oracle+ZOracleDA installation, but my guess is that
it's pretty much everything by default.

What are the different transaction isolation levels ?

Another question: would atomicity be better insured if I nested the SELECT
statement inside the INSERT ? (ie: INSERT INTO table VALUES (SELECT ...., ....)