Re: My ODBC concurrent Queries
Martin Evans <[email protected]> Tue, 26 May 2009 08:38:11 +0100
| Newsgroups | gmane.comp.db.mysql.odbc |
|---|---|
| Organization | Easysoft Limited |
| Message-ID | <[email protected]> |
J Jayavasanthan wrote: > Hi Armin, > No, the n threads use different connections, > > And Yes, the codebase is the same for Windows & Linux. > > BTW, additional information, from windows client connecting Windows & Linux > MySQL Servers, this problem doesn't arise. But only with Linux clients > connecting to Windows or Linux MySQL Servers, this problem arises, > > I am trying to prepare a testcase out of this, and will put it up shortly, > do let me know if I have missed something, > > Regards, > Jay > > > 2009/5/25 Armin Schöffmann <[email protected]> > >> Hi, >> tell us a few more implementation details on your app: >> In particular, do your n threads share one common db-connection? >> Do you use the same codebase for win & linux? >> >> armin. >> >> >>> -----Original Message----- >>> From: J Jayavasanthan [mailto:[email protected]] >>> Sent: Monday, May 25, 2009 12:50 PM >>> To: [email protected] >>> Subject: My ODBC concurrent Queries >>> >>> Hi, >>> In my application, the mysql server is connected via ODBC and we run >>> multiple threads executing multiple queries with the mysql server. >>> There is >>> an issue in our application when we execute a bulk query (more than >>> 100,000 >>> rows in resultset) and when the query takes a longer time for execute, >>> all >>> the other threads seem to just hang on their db operations. >>> >>> We are even unable to get past the 'use database' query in most cases >>> from >>> other threads. Is this a limitation on the ODBC implementation in linux >>> or >>> have we failed to turn-on any options while building our ODBC drivers, >>> do >>> let us know. >>> >>> In Windows, we are able to execute simultaneous queries using ODBC. >>> This >>> test environment uses all pre-compiled binaries from MySQL website. >>> >>> In Linux, we are facing the above issues >>> >>> Linux Flavor - Cent OS 5.2 >>> MySQL Server version - 5.1.30 >>> unixODBC version - 2.2.11 >>> myODBC version - 3.51.27 >>> >>> All Linux binaries are compiled in the same system as they are running. >>> >>> When we execute two queries as separate processes (same executable >>> started >>> as different processes), we are able to do so. But, when we create two >>> separate threads within the same process, then the above hang up >>> arises. Is >>> there any particular option in building our application we have missed, >>> do >>> let us know, >>> >>> Regards, >>> Jayavasanthan J > > > Have you examined the threading options in unixODBC? i.e., Threading = N for a driver in your odbcinst.ini file. You can read the possible values from one of the source modules for unixODBC - I think it is _handles.c. If the mysql ODBC driver is thread-safe then you can set Threading = 0 and unixODBC will do nothing to protect the ODBC driver but I cannot remember right now what it defaults to - probably 1 or 2 for environment or connection. Also, you might want to look at whether you share the same environment between threads even if they are using different connections (see SQLAllocHandle for an environment). Martin -- Martin J. Evans Easysoft Limited http://www.easysoft.com -- MySQL ODBC Mailing List For list archives: http://lists.mysql.com/myodbc To unsubscribe: http://lists.mysql.com/[email protected]