> First shot of a PostgreSQL driver, MySQL driver modified.
>
> Hi all,
>
> I just uploaded a first build of the BALL with PostgreSQL support.
>
> Changes:
>
> I) The formal of the XSQL connection definitions (distributed in
> policy/xsql-definition.xml) has changed. A connection has now a
> 'driver' child element (which might be moved in further releases to
> become an attribute of the connection, I'm not sure what's the
> right way here). The content of that element define, which data
> base driver is to be used. Example
>
> <!-- This connection is universally open. -->
> <connection>
> <name>demo</name>
> <driver>MySQL</driver>
> <database>test</database>
> <host>localhost</host>
> <user>test</user>
> <password></password>
> </connection>
>
> Currently two values are supported "MySQL" and "PostgreSQL".
>
> II) The mysql driver has changed slightly. It used to block the whole
> ball until the query completes. At least Frank has suffered from
> mysql queries taking so long, that BALL's heartbeat decided the
> Askems server was locked up and killed it[1]. Unfortunately I've
> not found a mysql API, which allows asynchronous notification or
> polling about query completion. Therefore I just inserted a
> configurable delay between the mysql query and response retrieval.
> Call (set-mysql-query-time! (milliseconds <integer>)) in your
> configuration to adjust that delay (defaults to 20 ms).
>
> Having written that, it turned out, that mysql_real_query is to
> blame. It turned out that the ball stoped during this call. Does
> someone have some info how to tune mysql not to block there?
hi Jerry,
after updating rscheme and askemos now I test some applications local.
I change the connection parameters how descripted in I.
This error message occured by any mysql requests ?
Sat, 06 Dec 2003 23:51:19 +0100 <simple-error> error: sql-field: generic function doesn't understand #[<mysql-result> @087d_56fb]
(rest are (0))
((stack . @085b_393b))
So I testing the new tuning parameter in config - askemos silence, how you noted
heartbeat: "Kernel did not send alive signal, killing it."
I overload some more in the config, grapped from mysql.scm
(define *mysql-query-time* 1000)
(define (set-mysql-query-time! (n <integer>))
(set! *mysql-query-time* n))
now askemos isn't hanging, but may be ignored
Our applications based on the mysql db, so I must stop the test on this point and waiting.
bye Frank
>
> III) The new PostgreSQL driver is almost identical to the mysql
> driver, except that PostgreSQL has 'PQisBusy', which allows me to
> poll for query completion. Though this is better (and should
> therefore become the recommented way to use XSQL within BALL) than
> the mysql interface, it's still not satisfactory. If anyone could
> point me to some notification interface, possibly with example
> code, that would be great.
>
> For the time being, you can adjust the polling interval in your
> configuration using (set-pgsql-query-time! (milliseconds <integer>))
>
> Please note that this code is not yet tested and I will not have the
> time to test it right now. Please help.
>
> Best regards
>
> /J�rg
>
> Footnotes:
>
> 1) Actually I'm curious to see what huge or complicated data base
> query will keep mysql busy for more than two seconds. Frank, can
> you provide some details?
>
> --
> The worst of harm may often result from the best of intentions.
|