Обсуждение: Strange behaviour with Autocad/ODBC
Hi everybody, I'm using Autocad Map to perform some GIS work. My data is in vector format, and it's linked to tables in a PostgreSQL 7.0.2 database thru ODBC. I'm using ODBC driver release 7.01.003. In AutoCAD I can look at table with few records, but if I attempt to open a table with 1000 records AutoCAD crashes. If I ask the driver to use declare/fetch that doesn't happens, and I can look at tables of any size (and I see all the records, so everything goes fine). I could be happy like this, but pgAdmin does not work properly with such option (I cannot see the data contained in a table, it complains that it cannot open a bi-directional recordset). I'm sure that it's an AutoCAD fault, that it's badly written software, but I was wondering why everything goes well with declare/fetch... someone can help me? By the way, AutoCAD 2000 uses ADO to access data (at least, that's what they claim, but I also write sw in VB and everything goes fine...) Bye Andrea
On Tue, Feb 20, 2001 at 10:50:17AM +0100, Andrea Aime wrote: > Hi everybody, > I'm using Autocad Map to perform some GIS work. My data is in vector > format, and it's linked to tables in a PostgreSQL 7.0.2 database thru > ODBC. I'm using ODBC driver release 7.01.003. In AutoCAD I can look > at table with few records, but if I attempt to open a table with 1000 > records AutoCAD crashes. If I ask the driver to use declare/fetch that > doesn't happens, and I can look at tables of any size (and I see all > the records, so everything goes fine). I could be happy like this, > but pgAdmin does not work properly with such option (I cannot see > the data contained in a table, it complains that it cannot open > a bi-directional recordset). I'm sure that it's an AutoCAD fault, > that it's badly written software, but I was wondering why everything > goes well with declare/fetch... someone can help me? Hmm, sounds like AutoCAD does something memory intensive with the data. When you open a table with declare/fetch, the ODBC driver uses a cursor to only retrieve a few rows at a time from the table. On normal open, you get _all_ the rows, and the application has to deal with them all at once. > By the way, AutoCAD 2000 uses ADO to access data (at least, that's > what they claim, but I also write sw in VB and everything goes fine...) I'm not sure about these details, but it's possible that with lots of interface layers, you're getting multiple copies of the datasets resident in different layers, thereby consuming even more memory. Have you considered creating _two_ ODBC datasources, both pointing at the same DB, one with declare/fetch for AutoCAD, and one without, for PgAdmin? Ross
"Ross J. Reedstrom" wrote: > > On Tue, Feb 20, 2001 at 10:50:17AM +0100, Andrea Aime wrote: > > Hi everybody, > > I'm using Autocad Map to perform some GIS work. My data is in vector > > format, and it's linked to tables in a PostgreSQL 7.0.2 database thru > > ODBC. .... > > Have you considered creating _two_ ODBC datasources, both pointing at the > same DB, one with declare/fetch for AutoCAD, and one without, for PgAdmin? > > Ross heh, yes, I've thougt about it, but that's a workaround, not a straight solution... I asked just to put inform people working on the source code, good software usually deals also with misbehaved clients... :-) Anyway, ODBC driver is already a great piece of sw... :-) Bye
> -----Original Message----- > From: Andrea Aime [mailto:aaime@comune.modena.it] > Sent: 21 February 2001 07:16 > Cc: Postgres ODBC > Subject: [ODBC] Re: Strange behaviour with Autocad/ODBC > > > > > > Have you considered creating _two_ ODBC datasources, both > pointing at the > > same DB, one with declare/fetch for AutoCAD, and one > without, for PgAdmin? > > > > Ross > > heh, yes, I've thougt about it, but that's a workaround, not > a straight > solution... I asked just to put inform people working on the source > code, good software usually deals also with misbehaved clients... :-) > Anyway, ODBC driver is already a great piece of sw... :-) > Bye Hey, don't knock pgAdmin, it's not my fault! Just because ADO can only do forward-only recordsets with Declare/Fetch on... Seriously though, ADO can't use server side cursors on PostgreSQL because (presumably) the ODBC driver doesn't support them to a high enough level. If can you see the query that is causng AutoCAD to crash if you switch on the drivers commlog? If so, if you run it in pgAdmin, does it crash? Regards, Dave.
Dave Page wrote: > > > -----Original Message----- > > From: Andrea Aime [mailto:aaime@comune.modena.it] > > Sent: 21 February 2001 07:16 > > Cc: Postgres ODBC > > Subject: [ODBC] Re: Strange behaviour with Autocad/ODBC > > > > > > > > > Hey, don't knock pgAdmin, it's not my fault! Just because ADO can only do > forward-only recordsets with Declare/Fetch on... Sorry Dave, it wasn't my intention do knock pgAdmin, it's a great piece of sw... my intention was to complain about AutoCAD, not pgAdmin > > Seriously though, ADO can't use server side cursors on PostgreSQL because > (presumably) the ODBC driver doesn't support them to a high enough level. > > If can you see the query that is causng AutoCAD to crash if you switch on > the drivers commlog? If so, if you run it in pgAdmin, does it crash? Yes, it's a plain "select * from table" that return 1600 records. Previuous releases of Autocad used DAO, I suspect that AutoCAD 2000 still uses some part of DAO... in fact, making some experiment with VisData I found some strange behaviour (sometimes I can't look at table contents,in particular if using DBGrid output... the same that's used by AutoCAD I suspect). VisData is provided as an add-in with Visual Basic, and still uses DAO to access databases. Another strange thing is that AutoCAD sees my data source as read only, even if it isn't (I can modify data both using pgAdmin and ADO directly). Bye Andrea