El martes, 25 de septiembre de 2012 09:05:47 UTC-3, Karen Tracey escribió:
>
> On Mon, Sep 24, 2012 at 10:15 PM, maxi <maxir...@gmail.com 
> <javascript:>>wrote:
>
>> Hi,
>>
>> DatabseFeatures class has a supports_transactions property for test if 
>> the db engine support transactions.
>> supports_transactions implementation makes  some metadata alters to check 
>> this behaivor.
>>
>> Now, is really needed to do this to check transaction support? 
>> I don't know exactly how many times this supports_transactions is called 
>> but I think what it produce unnecessary alterations in database structure, 
>> or I'm misinterpreting how it supposed works.
>>
>>
>
Hi Karen,
 

> First, this method is used during testing, generally not during normal 
> operation. It's implemented as a cached property so regardless of how many 
> times the value is tested the underlying code which creates and drops a 
> table is only actually called once per database. Is it needed? We need to 
> know if the database actually supports transactions or if 
> commit/rollback/etc are simply no-ops. If you know of an alternative way of 
> determining this, that works across all databases, please share. I added 
> that code and I've never liked it but I don't know of another way to 
> accomplish what it needs to do.
>
>
No, I just answer because it caught my attention. Why not just trust in a 
True/False property ?
BTW, What do you mean with "commit/rollback/etc are simply no-ops" ?

I'm working on django-firebird backend implementation (now using the new 
firebird python-driver "fdb") and I need reimplement supports_transactions, 
because I need to commit any work before drop the table, otherwise, I fall 
into "Object in use" error.

Regards.
---
Maxi







 

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-developers/-/XgRv40ktvFYJ.
To post to this group, send email to django-developers@googlegroups.com.
To unsubscribe from this group, send email to 
django-developers+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-developers?hl=en.

Reply via email to