[SqueakDBX] Re: Gofer for GlorpDBX

Mariano Martinez Peck marianopeck at gmail.com
Sun Jan 10 20:59:01 UTC 2010


On Sun, Jan 10, 2010 at 9:49 PM, John Toohey <jt at parspro.com> wrote:

> My app is a private one, with about 30+ users are a given time, however,
> its must be responsive for all these users, as they are updating markets
> prices etc. When a market closes, I need to updates a few thousand records,
> and during that time, I cannot have the image *frozen*, as it would effect
> the other users, in a time critical application. I haven't been able to do
> proper stress tests yet, as I'm still wrapping up functionality, but based
> on what I've read, I decided that using a SP to perform the updates would be
> faster.
>
>
Ok. That's perfect. However, let me remark something. As you may know,
SqueakDBX uses FFI to talk to OpenDBX. FFI locks THE COMPLETE VM while the C
function is being executed. And that cannot be change. What you can change
is try to do those functions as little time as possible. Imagine a query and
that the function does not return until the query is done. THAT will freeze
the image for a long time. However, we have a better strategy.

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  ].


I invite you to read the slides: http://www.slideshare.net/esug/squeak-dbx
There I explain this comparing SqueakDBX against ODBC driver for squeak.

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 ?

Cheers

Mariano


> Did I misunderstand this?
>
>
> On Sun, Jan 10, 2010 at 15:27, Mariano Martinez Peck <
> marianopeck at gmail.com> wrote:
>
>>
>>
>> On Sun, Jan 10, 2010 at 9:23 PM, John Toohey <jt at parspro.com> wrote:
>>
>>> Nice, I didn't notice these on the site before. Seem OpenDBX wins easily
>>> with inserts to Postgres. Unfortunately, because of the image freezing
>>> during a large amount of updates/inserts,
>>
>>
>> Can you explain me this a bit more? The image "should" "freeze". Actually,
>> the queries are running in a most important priority than the UI. However,
>> for example you have a Seaside website, and there comes another request from
>> another user and sends a query to the database, it should also process this
>> new request.
>>
>>
>>> I'm going to a stored procedure for that.
>>>
>>>
>>> On Sun, Jan 10, 2010 at 14:56, Mariano Martinez Peck <
>>> marianopeck at gmail.com> wrote:
>>>
>>>>
>>>>
>>>> On Sun, Jan 10, 2010 at 5:51 PM, John Toohey <jt at parspro.com> wrote:
>>>>
>>>>> Thanks, this is what I wanted. It takes time to build a new image from
>>>>> scratch, so I want to use Gofer to install Seaside, Glorp, my code etc. I
>>>>> wanted to get a script that was tested and would give me the latest builds.
>>>>> Just wondering if you have an benchmarks on using the Native driver with the
>>>>> GlorpDBX. I'm going into production soon, and still am not sure what way to
>>>>> go.
>>>>>
>>>>>
>>>> Hi John. There are becnhmarks for SqueakDBX agains native drivers, but
>>>> not related with GlorpDBX. Although, if one driver is faster, it make sense
>>>> that GLorp is faster too using that driver.
>>>>
>>>> The SqueakDBX benchmarks  were of the first things we did when we start
>>>> SqueakDBX. You can read this link: http://www.squeakdbx.org/Benchmarks
>>>>
>>>> You can run them by yourself and compare.
>>>>
>>>> Ask if you need help with that :)
>>>>
>>>> Cheers
>>>>
>>>> Mariano
>>>>
>>>>
>>>>>
>>>>> On Sat, Jan 9, 2010 at 17:41, Mariano Martinez Peck <
>>>>> marianopeck at gmail.com> wrote:
>>>>>
>>>>>>
>>>>>>
>>>>>> On Sat, Jan 9, 2010 at 11:24 PM, John Toohey <jt at parspro.com> wrote:
>>>>>>
>>>>>>> Have you made a Gofer script to install the latest GloprDBX and
>>>>>>> Postgres driver on the latest RC1 Pharo images? I'm trying to create a full
>>>>>>> Gofer script that will build my entire app from a Pharo DEV image.
>>>>>>>
>>>>>>>
>>>>>> Hi John. I didn't wrote any Gofer plugin and I even don't have it in
>>>>>> mind. The future of SqueakDBX and GlorpDBX packages managment will be with
>>>>>> Metacello.
>>>>>>
>>>>>> So far, you have in the repository MetacelloRepository in
>>>>>> squeakspurce, two packages: ConfigurationOfSqueakDBX and
>>>>>> ConfigurationOfGlorpDBX. The second one, right now it install GlorpDBX and
>>>>>> the SqueakDBX driver, NOT the PostgreSQL native driver. If this is what you
>>>>>> want, maybe I can add a group to metacello conf.
>>>>>>
>>>>>> Right now, to install SqueakDBX you have to evaluate:
>>>>>>
>>>>>> Gofer new
>>>>>>     squeaksource: 'MetacelloRepository';
>>>>>>     package: 'ConfigurationOfSqueakDBX';
>>>>>>     load.
>>>>>>
>>>>>> ((Smalltalk at: #ConfigurationOfSqueakDBX) project version: '1.0')
>>>>>> load.
>>>>>>
>>>>>>
>>>>>> And for GlorpDBX:
>>>>>>
>>>>>> Gofer new
>>>>>>     squeaksource: 'MetacelloRepository';
>>>>>>     package: 'ConfigurationOfGlorpDBX';
>>>>>>     load.
>>>>>>
>>>>>> ((Smalltalk at: #ConfigurationOfGlorpDBX) project version: '1.0')
>>>>>> load.
>>>>>>
>>>>>> If you really need to load GlorpDBX with Postgresql native driver,
>>>>>> than I can create a group so that you will be able to evaluate:
>>>>>>
>>>>>> ((Smalltalk at: #ConfigurationOfGlorpDBX) project version: '1.0')
>>>>>> load: 'GlorpDBXWithNativePostgreSQLNativeDriver'
>>>>>>
>>>>>> Do you need that?
>>>>>>
>>>>>> In addition, the loaders we wrote some time ago, should be running:
>>>>>>
>>>>>> Gofer new
>>>>>>     squeaksource: 'Glorp';
>>>>>>     package: 'ConfigurationOfGlorpDBX';
>>>>>>     load.
>>>>>>
>>>>>> GlorpPharoLoader loadGlorpWithNativePostgreSQLDriver
>>>>>>
>>>>>>
>>>>>>
>>>>>> --
>>>>>>> -JT
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>
>>>>>
>>>>>
>>>>> --
>>>>> -JT
>>>>>
>>>>>
>>>>>
>>>>
>>>
>>>
>>> --
>>> -JT
>>>
>>>
>>>
>>
>
>
> --
> -JT
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/squeakdbx/attachments/20100110/d73213f7/attachment.htm


More information about the SqueakDBX mailing list