On Nov 17, 3:00 am, Ian Kelly <ian.g.ke...@gmail.com> wrote: > The version check that you point out does not really need to be done > on every connection, I think. If we make a connection and find one > version and then later make a new connection using the same > DatabaseWrapper, we expect the database to still be the same version. > I would propose that instead of dropping support, we make this check > once per DatabaseWrapper per thread, in the same way that the LIKE > operators are already configured.
+1. There is some other cleanup needed in there, too. In DatabaseOperations: """ def regex_lookup(self, lookup_type): # If regex_lookup is called before it's been initialized, then create # a cursor to initialize it and recur. self.connection.cursor() return self.connection.ops.regex_lookup(lookup_type) """ in DatabaseWrapper.cursor for new connections: """ try: self.oracle_version = int(self.connection.version.split('.')[0]) # There's no way for the DatabaseOperations class to know the # currently active Oracle version, so we do some setups here. # TODO: Multi-db support will need a better solution (a way to # communicate the current version). if self.oracle_version <= 9: self.ops.regex_lookup = self.ops.regex_lookup_9 else: self.ops.regex_lookup = self.ops.regex_lookup_10 except ValueError: pass """ 1. It could be better if regex_lookup did the redirection to the correct regex_lookup implementation. As is, dbwrapper needs to know internals of ops, and ops rely on internals of dbwrapper. 2. What happens if that ValueError is hit and regex_lookup is called? I hope it isn't actually possible to hit the ValueError. 3. Is that TODO still accurate? - Anssi -- 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.