[storm] How to set isolation level in storm

Jamu Kakar jkakar at kakar.ca
Thu Jun 18 22:42:50 BST 2009

Hi Barry,

On Thu, Jun 18, 2009 at 12:16 PM, Barry Warsaw<barry at canonical.com> wrote:
> On Jun 18, 2009, at 2:04 PM, Jamu Kakar wrote:
>> Welcome to Storm! :) You can specify the isolation level in the URI
>> you pass to create_database, for example:
>> postgres://user:password@host/database?isolation=autocommit
>> postgres://user:password@host/database?isolation=read-committed
> Part of me wishes there were alternative apis for setting some of these
> url-based attributes.  For example, I wanted to set the timeout value for
> sqlite, but there's no public api for doing that afaict, apart from setting
> it in the url.

A supported API would be more friendly than running SQL commands to
do the same things, but for now you can just run the relevant SQL
directly.  For example, you can set the statement timeout for
PostgreSQL by running this query (I don't know if an equivalent is
possible with SQLite):

store.execute("SET statement_timeout TO 1000")

There might be some set of properties that are common to all the
databases we care about that we could provide an API to, but my
suspicion is that there are subtle differences in terms of semantics
between databases.  But maybe I'm wrong, and we just need to provide
an easy way to invoke the appropriate query for whatever backend you
happen to be using?


More information about the storm mailing list