On Mon, Sep 24, 2012 at 10:15 PM, maxi <maxiroba...@gmail.com> 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. > > 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. Karen -- 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 django-developers+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-developers?hl=en.