[storm] How to set isolation level in storm

Gustavo Niemeyer gustavo at niemeyer.net
Fri Jun 19 15:42:05 BST 2009


> 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
>
> There's a general expectation in Storm that you will be using
> serializable isolation, so you'll probably want to a bit careful if
> you use something other than that.

Indeed.  Please be aware that Storm does caching and invalidates the
cache on transaction boundaries (once you do commit() or rollback(),
for instance).  This works perfectly when using "serializable-style"
isolation levels, since the database and the cache will represent the
same data.  If you change the isolation level, the caching on the
Storm side will *still* happen, and will continue to be invalidated on
transaction boundaries by default, so it's very important to keep this
in mind when coding if you don't want to be surprised.

-- 
Gustavo Niemeyer
http://niemeyer.net



More information about the storm mailing list