Thread: odbc driver problem? or threading? or crecordset?
hi there! im new to psqlodbc, and i hope you pros could help me out :) i have been browsing the internet for more than a week now, searching for clues regarding an "access violation" error. i hope maybe you can help me get over this problem, as it has been eating my dev schedule. here's the problem: i have two threads triggered by onTimer which is set to 1 second. when the timer expires, the threads are notified, and a (select) query is started. both threads use the same recordset class, but different instance. thread1 accesses server1 using datasource1. thread2 accesses server2 using datasource2. both tables are the same on both servers, but have different values. that is why they use the same recordset. after a few timerEvents, the program stops, and the error message "access violation" is shown. during debug, i traced that the error occurs when both thread attempts to call the crecordset::open function. at the same time. even though they access different datasources, the problem keeps coming back. i only issue a simple select statement with the following options -- (crecordset::snapshot, crecordset::readonly). the recordset is open()ed and close()d after every query. the cdatabase instance is not. it remains open. is there something i missed? thanks, vincentl --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.605 / Virus Database: 385 - Release Date: 3/1/2004
Hello, did you try the latest build ? http://www.geocities.jp/inocchichichi/psqlodbc/ bye, markus. ""Vincent Ladlad"" <vincentl@ntsp.nec.co.jp> schrieb im Newsbeitrag news:014701c40af5$4d6c6070$643b1cac@Titanium... > hi there! im new to psqlodbc, and i hope you pros could help me out :) > > i have been browsing the internet for more than > a week now, searching for clues regarding an > "access violation" error. i hope maybe you can > help me get over this problem, as it has been > eating my dev schedule. > > here's the problem: > i have two threads triggered by onTimer which > is set to 1 second. when the timer expires, > the threads are notified, and a (select) query is started. > both threads use the same recordset class, but > different instance. thread1 accesses server1 using datasource1. thread2 > accesses server2 using datasource2. both tables are the same on both > servers, but have different values. that is why they use the same > recordset. > after a few timerEvents, the program stops, and the > error message "access violation" is shown. > during debug, i traced that the error occurs when > both thread attempts to call the crecordset::open function. > at the same time. even though they access different > datasources, the problem keeps coming back. i only > issue a simple select statement with the following options -- > (crecordset::snapshot, crecordset::readonly). > > the recordset is open()ed and close()d after every query. > the cdatabase instance is not. it remains open. > > is there something i missed? > > thanks, > vincentl > > --- > Outgoing mail is certified Virus Free. > Checked by AVG anti-virus system (http://www.grisoft.com). > Version: 6.0.605 / Virus Database: 385 - Release Date: 3/1/2004 > > > > ---------------------------(end of broadcast)--------------------------- > TIP 6: Have you searched our list archives? > > http://archives.postgresql.org >
Hi again, yes, i used the latest build found in gborg (7.03.02) i found this on microsoft's web: --- BUG: Repeatedly Opening or Closing CRecordset in an Access Violation in the ODBC Cursor Library Applies To This article was previously published under Q173513 BUG #: 4797 (NT: ODBC30) SYMPTOMS An ODBC application may get an access violation (AV) using the ODBC cursor library (Odbccr32.dll) if both of the following conditions are true: It creates more than one CRecordset objects. -and- The following operations are done repeatedly on the CRecordset objects: Open, MoveLast or Requery and Close. The access violation error happens when the application tries to use the Close method of CRecordset or invoke the SQLFreeStmt ODBC function. STATUS Microsoft has confirmed this to be a problem in Open Database Connectivity version 3.0. This problem has been corrected in Open Database Connectivity version 3.5. The information in this article applies to: Microsoft Open Database Connectivity 3.0 Last Reviewed: 3/7/2003 (2.0) Keywords: kbbug kbprogramming KB173513 --- is the fix included in the latest psqlodbc driver release? or is my problem even related to this? -----Original Message----- From: pgsql-odbc-owner@postgresql.org [mailto:pgsql-odbc-owner@postgresql.org] On Behalf Of Markus Donath Sent: Tuesday, March 16, 2004 5:56 PM To: pgsql-odbc@postgresql.org Subject: Re: [ODBC] odbc driver problem? or threading? or crecordset? Hello, did you try the latest build ? http://www.geocities.jp/inocchichichi/psqlodbc/ bye, markus. ""Vincent Ladlad"" <vincentl@ntsp.nec.co.jp> schrieb im Newsbeitrag news:014701c40af5$4d6c6070$643b1cac@Titanium... > hi there! im new to psqlodbc, and i hope you pros could help me out :) > > i have been browsing the internet for more than > a week now, searching for clues regarding an > "access violation" error. i hope maybe you can > help me get over this problem, as it has been > eating my dev schedule. > > here's the problem: > i have two threads triggered by onTimer which > is set to 1 second. when the timer expires, > the threads are notified, and a (select) query is started. > both threads use the same recordset class, but > different instance. thread1 accesses server1 using datasource1. thread2 > accesses server2 using datasource2. both tables are the same on both > servers, but have different values. that is why they use the same > recordset. > after a few timerEvents, the program stops, and the > error message "access violation" is shown. > during debug, i traced that the error occurs when > both thread attempts to call the crecordset::open function. > at the same time. even though they access different > datasources, the problem keeps coming back. i only > issue a simple select statement with the following options -- > (crecordset::snapshot, crecordset::readonly). > > the recordset is open()ed and close()d after every query. > the cdatabase instance is not. it remains open. > > is there something i missed? > > thanks, > vincentl > > --- > Outgoing mail is certified Virus Free. > Checked by AVG anti-virus system (http://www.grisoft.com). > Version: 6.0.605 / Virus Database: 385 - Release Date: 3/1/2004 > > > > ---------------------------(end of broadcast)--------------------------- > TIP 6: Have you searched our list archives? > > http://archives.postgresql.org > ---------------------------(end of broadcast)--------------------------- TIP 1: subscribe and unsubscribe commands go to majordomo@postgresql.org --- Incoming mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.605 / Virus Database: 385 - Release Date: 3/1/2004 --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.605 / Virus Database: 385 - Release Date: 3/1/2004
Vincent Ladlad wrote: >Hi again, > >yes, i used the latest build found in gborg (7.03.02) >i found this on microsoft's web: > > >STATUS >Microsoft has confirmed this to be a problem in Open Database >Connectivity version 3.0. This problem has been corrected in Open >Database Connectivity version 3.5. > > IF this is indeed your problem, updating your ODBC infrastructure (from Microsoft) will solve it. This is not a bug in any particular ODBC driver, but in the MS cursors library itself. -- Shachar Shemesh Lingnu Open Systems Consulting http://www.lingnu.com/