Re: How the transactions are done in the saveChanges?

Marco Bizzarri <[email protected]> Fri, 13 Aug 2004 09:49:06 +0200
Newsgroups gmane.comp.python.modeling
Message-ID <[email protected]>
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Sebastien Bigaret wrote:
...

|
| BTW: if you set the env. variable 'MDL_ENABLE_DATABASE_LOGGING' then
you'll get
| a copy of the framework db-related actions on stderr (or anywhere else
if you
| modify Modeling.logging) --see the appropriate annex in the User's Guide.
|

Ok, I will take a look

|>Also, I've noticed that the ec.fetch() is a transaction which
|>terminates with an abort. Is this correct?
|
|
| This is intentional, anyhow ;)  Such a transaction should be
terminated, and I
| cannot see any reason why it should be COMMITed, hence it is ABORTed!
  But if
| you think differently, please let us know!
|

One of the basic reason for this is in the debugging/maintenance of the
system.

When you need to look for the DB log, it is useful to spot the problems
by mean of ABORTed transactions. If the aborted transactions are the
standard, this can be a problem.

|
|>2) how are the db transaction executed/completed inside a Zope
|>transaction? In a non-zope application, I can see each fetch()
|>produces a transaction, as well as the ec.saveChanges(). Is this true
|>also in Zope applications?
|
|
| Yes it is.  The zope support basically consists in providing a default
| EditingContext per session, possibly also connecting this EC's
| saveChanges() to the transaction machinery (i.e. to each
request/response loop).
|  That's all, and everything else will be handled in your ZProducts'
code, just
| the same way you would make it in pure python.
|
| 	Hope this helps,
|
| -- Sébastien.

Yes and no... I would prefer to be able to tell ModelingFramework when
it should start/stop a transaction on the db... howevr, thanks of the
answer...
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFBHHJxXhfyAQQVoaIRAogVAKC4xp1v+Ttxp6wmjxWotOpYPtvq6gCdHIyC
ric78zFY9j+Ifbc5eoVMilE=
=hFeZ
-----END PGP SIGNATURE-----


-------------------------------------------------------
SF.Net email is sponsored by Shop4tech.com-Lowest price on Blank Media
100pk Sonic DVD-R 4x for only $29 -100pk Sonic DVD+R for only $33
Save 50% off Retail on Ink & Toner - Free Shipping and Free Gift.
http://www.shop4tech.com/z/Inkjet_Cartridges/9_108_r285