On 2 mai, 10:55, Ivan Sagalaev <[EMAIL PROTECTED]> wrote:
> Jean-François wrote:
> > My question was not really specific to any database backend (aggree
> > that probably all database system, including Rdb can start a
> > transaction implicitly, inclugind Rdb). But as I have noticed that a
> > method start_transaction_sql() exist I have expect that this method
> > was used.
>
> It is. But it used in only one place: when Django creates a script with
> DDL operators for database creation. I can even guess the reason for it.
> Historically Django was wrapping all "ALTER TABLE"s in a single BEGIN;
> .. COMMIT; block. Contrary to common disbelief It works as expected in
> PostgreSQL. In MySQL it doesn't work but also doesn't do any harm. And
> when Oracle backend came by I think it was failing on this thing. This
> is why Oracle is the only backend that overrides start_transaction_sql()
> to make it an empty string instead of 'BEGIN;'.
>

Ok I understand, if I remember correctly Oracle, like MySQL and many
others databases autocommit DDL operations.

> > So  to not commit, even a read only transaction, may introduced hand
> > in a multi-processes architecture.
>
> Ah... Got it. But it's not a problem in Django because each connection
> is closed altogether and thus rollbacked at the end of each request.


Oops... I haven't thought to trace connect/disconnect operation to the
database only commit/rollback.
Now, I have a better understanding of the underlaying model. I suspect
that open a database connection then closing it for each request may
be a fairly expensive operation on most database systems, but I have
no bench for this.

Many thanks for your help.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To post to this group, send email to django-developers@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to