[Zope-DB] Questions on DAs and TAs

kapil thangavelu kvthan@wm.edu
Wed, 11 Sep 2002 10:47:45 -0700

On Wednesday 11 September 2002 02:48 am, Martin Gebert wrote:
> Hi all!
> For further work on Zope and DB connectivity I'd like to ask some
> questions which I need to clarify. I beg your pardon if they've been
> asked and answered already; hints for ressources are very welcome.
> - Are there developers documents on DAs, esp. API references? I found
> two docs of petrilli (Roadmap for Zope Database Adapters
> <http://www.zope.org/Members/petrilli/DARoadmap> and How to Write a DA
> <http://www.zope.org/Members/petrilli/WritingADA>) which should give me
> the basics, but they seem to be a little outdated (from 1999/2000), so I
> wonder if there are more ressources on this subject?

mailing list archives.

> - As I understand from reading some relevant postings in the archives of
> this list, RDBMS transactions in Zope are bound to the Zope TA concept,
> where TAs start and end with building a DTML document (correct/put too
> simple?). Are there any possibilities to force TA management by
> commit/rollback actions via the DA? (How) Can I manually rollback if
> something in a script fails? The ZopeBook says less more than nothing
> about that subject... :-(

zope transaction boundaries are demarcated by a single request. zope will 
integrate with third party RDBMS that support transactions, by acting as a 
Transaction authority via a two-phase-commit protocol, such that if zope's 
transaction succeeds the rdbms will commit, etc.

manual manipulation of the DA transaction status is not explictily supported, 
which is to say its nots explicity forbidden ;-).

> - Did I get it right that (explicit) locking has to happen in Z SQL
> Methods? Having experience with Oracle locking mechanisms only, I wonder
> if that offers independence from different DBMS's (e. g. migrating a DB
> from, say, Oracle to MySQL, and having to change the Z SQL Methods due
> to different locking paradigms instead of simply setting up a new DA;
> hope you can follow what I try to express...). Are there no methods for
> locking in the DA API?

locking semantics and to a lesser extent locking syntax are very database 
idiosyncratic. oracle to mysql with innodb might be ok, depends on what kind 
of locking your doing. select for update, row lock syntax are generally 
supported although the semantics can vary a little.

zsql methods do not offer infrastructure support for locking, but you can so 
manually within the text body of your zsql method (as you could with txn 
control). zsql methods are just templates of strings that get sent to the db 
for execution.

> Thank you for reading; all hints on this subject are very welcome.
> Probably more questions to come...