On Nov 20, 2013, at 3:56 PM, Ed Singleton <singleto...@gmail.com> wrote:
> On 20 Nov 2013, at 15:56, Michael Bayer <mike...@zzzcomputing.com> wrote: > >> >> On Nov 20, 2013, at 9:39 AM, Ed Singleton <singleto...@gmail.com> wrote: >> >>> I'm getting a Memory error when trying to get data from my database. It >>> happens during a process that loads fixture data into the database, but the >>> error always happens at the same point on a line that fetches a single >>> record from the db. >>> >>> Essentially the line does `item = session.query(my_class).get(['ccp', >>> 'en'])`. The table only has around 10 rows in it. The code works fine >>> with sqlite. >>> >>> I'm not entirely sure what MemoryError means, but I put a bit of logging in >>> the app and `session.identity_map` only contains 32 items, and >>> `gc.get_objects()` has a length of 300,000, which doesn't seem unreasonable. >>> >>> I'm running Python 2.6 on a Mac (10.8) and the SQL Server is running on a >>> Windows 7 VM, with freetds and unixodbc in-between them. >>> >>> I'd really like some advice on how to debug this as I'm not at all sure. >> >> I’m assuming you’re using pyodbc. I’ve never been able to get unixodbc to >> work on OSX with pyodbc, OSX uses iODBC by default and pyodbc works better >> in that case. Even with the latest Pyodbc, I get lots of errors like this >> on OSX with FreeTDS 0.91 and iODBC and there’s no sign of them being fixed, >> so for OSX I’d stick with iODBC + FreeTDS 0.86. > > Sorry, yes, I should have said I'm using pyodbc. > > I tried using iODBC, but I couldn't get iodbctest to recognise my DSNs, so I > used unixodbc as it 'just worked'. > > I'll give it another go, and I might try setting up a second VM running Linux > to run my tests off. I've had no problems with linux and unixodbc. unixodbc is what you should use on linux, but OSX comes pre-installed with iODBC (you can also download and install a newer version of iODBC, even build it from source, though neither is necessary), and pyodbc has been tested against iODBC on OSX more than with unixodbc. but in any case pyodbc crashes like crazy with the newer FreeTDS, it’s gotten better but I still have issues that aren’t resolved.
signature.asc
Description: Message signed with OpenPGP using GPGMail