[squeak-dev] Re: MySQL question?

Mariano Martinez Peck marianopeck at gmail.com
Tue Jan 12 22:33:57 UTC 2010


On Tue, Jan 12, 2010 at 11:29 PM, Andreas Raab <andreas.raab at gmx.de> wrote:

> Mariano Martinez Peck wrote:
>
>> The biggest problem I found with the ODBC driver for Squeak is that it
>> uses FFI and it locks the complete VM during the function invocation. In
>> ODBC, queries are synchronous, so, if you have a website with multipleusers,
>> and someone sends a query, it is likely the complete vm will be locked until
>> it finishes.
>>
>
> I've been wondering about that. It says here (
> http://wiki.squeak.org/squeak/6129):
> ---------------------------------------
> OpenDBX and FFI
> You can have a common problem which is that SqueakDBX, trough FFI...
> ---------------------------------------
>
> This implies you're using FFI to talk to OpenDBX.
> How's that different from ODBC?
>
>
That's exatly what it is explained in the slides, even with sequence
diagrams.

OpenDBX, when possible, uses asynchronous queries. This means that it just
calls a function to send the query, and then, it loops asking "is it
ready?"  until the query is done So, we have "little locks". The goods news
is that after asking, if there are other process in the queue, it should be
processed. With this way we process several queries "at the same time.".  Se
the method   DBXPlatform >> processNextResultSet: aConnection querySettings:
aQuerySettings

where we do:     (code = OpenDBX resultTimeout) ifTrue: [ (Delay
forMilliseconds: (aQuerySettings timeout asMiliseconds)) wait  ].

It is not the best solution, of course, but we are limited to FFI
implementation.

I said "OpenDBX, when possible"  because it not depends only in OpenDBX but
also in the client library. Some support this and some doesn't. But I think
most engines support this. I know PostgreSQL does. BTW, which OS are you
deploying on ?

Mariano


> Cheers,
>  - Andreas
>
>
>> You can see what I am talking about in my slides:
>> http://www.slideshare.net/esug/squeak-dbx
>>
>> There I compare both drivers. I am not an ODBC expert, so if someone think
>> that that's incorrect, please let me know.
>>
>> Cheers
>>
>> Mariano
>>
>> 2010/1/12 Miguel Enrique Cobá Martinez <miguel.coba at gmail.com <mailto:
>> miguel.coba at gmail.com>>
>>
>>
>>    El mar, 12-01-2010 a las 15:49 -0500, John Chludzinski escribió:
>>     > Took your all’s advice and switched to the ODBC driver.  Works well
>> !
>>     > Thanks.  ---John
>>
>>    Well, is your codebase but I would like to know why SqueakDBX isn't
>> good
>>    enough for you. AFAICT SqueakDBX is being maintained currently. Haven't
>>    seen much about ODBC in this lists in the past 3 years.
>>
>>    Anyway, if it fits to your project then that's is enough.
>>
>>    Cheers
>>    --
>>    Miguel Cobá
>>    http://miguel.leugim.com.mx
>>
>>
>>
>>
>> ------------------------------------------------------------------------
>>
>>
>>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20100112/723278ac/attachment.htm


More information about the Squeak-dev mailing list