IRC log for #storm on 20080708

00:00.44*** join/#storm wallflower (n=wallflow@ip-205-246-113-216.pool.grokthis.net)
00:54.42*** join/#storm kov (n=kov@debian/developer/kov)
04:09.16*** join/#storm thumper (n=tim@canonical/launchpad/thumper)
05:09.05*** join/#storm jukart (n=jukart@194.183.146.178)
05:14.39*** join/#storm jrydberg_ (n=johan@212.112.160.94)
06:08.17*** join/#storm dobee (n=dobee@lsfw01.lovelysystems.com)
07:28.44*** join/#storm goschtl (n=goschtl@p5B0BD034.dip.t-dialin.net)
08:07.06*** join/#storm jukart (n=jukart@lsfw01.lovelysystems.com)
08:09.38*** join/#storm mcella (n=mcella@ip-179-87.sn2.eutelia.it)
09:44.56tlynnIn case anyone here has write access to the tutorial, there's a typo: "code of line -> line of code"
10:47.01*** join/#storm goschtl (n=goschtl@p5B0BD034.dip.t-dialin.net)
11:15.22tlynnhow do you delete results matching a ResultSet?
11:15.34tlynnrows I should say
11:20.09*** join/#storm dobee (n=dobee@lsfw01.lovelysystems.com)
11:20.27*** join/#storm andrea-bs (n=andrea@ubuntu/member/beeseek.developer.andrea-bs)
11:32.25thervetlynn: using the remove() method
11:33.52tlynnthanks, is that an alternative to find()?
11:35.05tlynnapparently so.
11:35.28thervehum noe
11:35.36tlynnah, actually not. you have to do the find first. ok, thanks anyway.
11:35.56thervewell, you asked on a ResultSet
11:36.06therveyou get ResultSet by calling find() :)
11:36.20thervethe remove method of the store is only meant to remove one object
11:36.22tlynnok, so is there a ResultSet.remove, or do you have to iterate over the RS?
11:37.01thervethere is a Result.remove method
11:37.36tlynna Result? I've not come across those. is there proxying going on when I do e.g. RS.one()?
11:38.11tlynnin other words, how do I get a Result?
11:38.29thervearf arf sorry
11:38.33therveResultSet.remove
11:39.38tlynngood grief. I've somehow been overlooking that every time I've looked at that class signature in the docs. ok, thanks.
11:45.56tlynntherve: since you seem particularly au fait with storm, what's the best approach for managing transactions?
11:47.25thervetlynn: the same way you would do without storm?
11:47.42tlynnwell, I could wrap everything as in: store.commit(), something(), store.commit/rollback()
11:48.06tlynnbut then the first store.commit might commit outer stuff.
11:48.24tlynntransactional cursors are the best I've found without storm
11:49.30tlynnI basically don't know how to start-delimit a transactional block in storm
11:49.59therveoh ok
11:50.03therveyou don't have to start it
11:50.09thervethe first commit is not necessary
11:50.32tlynnbut I'd like to be able to assert that nothing else was outstanding at that point
11:50.40tlynnno changes, that is
11:51.11tlynnI don't want a rollback to roll back too much
11:53.52tlynnif I were writing dbapi2 stuff I'd do def f(c=None): if cursor is None: c=new_tx_cursor() // do_something()
11:54.18tlynnwhich means that I can make the do_something be part of a larger transaction
11:54.37tlynnoops, that should say "if c is None"
11:54.48tlynnI'll do the same here I think
11:56.07tlynnhmm, maybe not. I'm supposed to trust the store after all.
12:08.19radix<tlynn> but I'd like to be able to assert that nothing else was outstanding at that point
12:08.42radixunfortunately there's no begin() method
12:09.46tlynnI guess the best policy is just to cross my fingers and hope then :-)
12:10.05tlynnand do a commit after every write
12:10.39radixtlynn: if you're making some sort of service, you should basically commit after every request
12:10.58radixtlynn: if you want to be extra careful, you can .rollback() at the beginning
12:11.17radixwhich would ensure that nothing else gets committed accidentally, but doesn't tell you if there is uncommitted stuff
12:11.35tlynnhmm, not sure whether .commit at the start or .rollback is worse. :-)
12:12.46tlynnI think you're right though, to get the speed advantages I should only commit at the end of every successful webpage view
12:13.03radixI don't suggest that for speed
12:13.18radixbut rather the semantics
12:13.21tlynnwell, as an alternative to committing after every change
12:13.49radixyou should have try: handle_request(); except: store.rollback(); else: store.commit()
12:14.06tlynnyep, that seems the best
12:14.16radixso that a request is all or nothing as far as data manipulation goes
12:14.44tlynnit's still unpleasant though, since it makes the test code have to do the same thing
12:14.50radixnot really
12:15.07radixour test code in landscape doesn't call commit at all, in the common case
12:15.54radixyou can still inspect the data that was inserted/manipulated by a particular piece of code by doing a query on the store
12:16.09radixjust make sure you're using the same store in your tests that your app code is using
12:16.15tlynnI suppose that's fine. I'd prefer to let other code pretend there's no database there, but this is close enough
12:16.25radixI'm not sure what you mean
12:16.52radixyou don't want your unit tests to know about the store?
12:17.39tlynnno, the tests were a red herring, but this means that the request handling code knows about commit/rollback logic. as you've said, it's a sensible boundary for it though, so all's well.
12:17.53radixonly one part of it, and if you have a decent web framework, it's hookable :)
12:18.23radixor with a wrapper or something, so you don't need to hack your core web request handling logic if you don't want to
12:18.46radixboth twisted.web and zope can be hooked into to add transaction stuff pretty easily
12:19.32tlynnyep. some kind of abstract persistence.open() and persistence.close() is good enough.
12:19.47tlynnalas I'm using the web framework that is cgi
12:20.30tlynnon a codebase that dates back to python 1.5
13:12.55*** join/#storm kov (n=kov@debian/developer/kov)
14:35.31*** part/#storm goschtl (n=goschtl@p5B0BD034.dip.t-dialin.net)
16:06.28*** join/#storm nullie (n=ilya@87.254.150.141)
17:21.30*** join/#storm jukart (n=jukart@85-124-221-45.static.xdsl-line.inode.at)
17:49.35*** join/#storm rockstar (n=rockstar@75-171-142-52.hlrn.qwest.net)
18:22.13*** join/#storm jukart (n=jukart@85-124-221-45.static.xdsl-line.inode.at)
18:34.19*** join/#storm dobee (n=dobee@85-124-200-100.static.xdsl-line.inode.at)
18:47.29*** join/#storm bigdo2 (n=scmikes@72-197-8-8-arpa.cust.cinci.current.net)
19:13.30*** join/#storm thumper (n=tim@canonical/launchpad/thumper)
19:26.12*** join/#storm dobee (n=dobee@213162066151.public.t-mobile.at)
23:24.17*** join/#storm kov (n=kov@debian/developer/kov)

Generated by irclog2html.pl Modified by Tim Riker to work with infobot.