Re: My ODBC concurrent Queries
J Jayavasanthan <[email protected]> Wed, 27 May 2009 16:48:18 +0530
| Newsgroups | gmane.comp.db.mysql.odbc |
|---|---|
| Message-ID | <[email protected]> |
Sorry I forwarded this response only to Martin, And I have found a resolution to the above problem with Threading =0/1/2, but I am facing other problems related to connection pooling. I am following up with that issue on the other thread, hopefully I will find the resolution soon, Once again I apologize for not closing down this thread. Regards, Jay ---------- Forwarded message ---------- From: J Jayavasanthan <[email protected]> Date: Tue, May 26, 2009 at 5:42 PM Subject: Re: My ODBC concurrent Queries To: Martin Evans <[email protected]> I think this resolves my query, Thanks Martin, Thanks for your inputs Regards, Jay On Tue, May 26, 2009 at 1:08 PM, Martin Evans <[email protected]>wrote: > 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 > > -- first me then home first home then country first country then world fools always read inverse