Re: requests and transactions

2011-03-31 Thread Chris Withers
On 01/04/2011 07:23, Brian Sutherland wrote: On Thu, Mar 31, 2011 at 04:49:38PM +0100, Chris Withers wrote: - isDoomed support: I guess this could be added to the example; can someone explain when isDoomed is True and what happens if that transaction is committed instead of being manually aborte

Re: requests and transactions

2011-03-31 Thread Brian Sutherland
On Thu, Mar 31, 2011 at 04:49:38PM +0100, Chris Withers wrote: > - isDoomed support: I guess this could be added to the example; can > someone explain when isDoomed is True and what happens if that > transaction is committed instead of being manually aborted? If isDoomed is True the transactio

Re: ATTN: Please keep general discussion on pylons-discuss

2011-03-31 Thread Mike Orr
On Thu, Mar 31, 2011 at 7:14 AM, Chris Withers wrote: > On 15/03/2011 20:01, Ben Bangert wrote: >> >> Here's a quick way to know which one to post to: >> pylons-devel >> - Discussion about development of pylons project libraries such as >> pylons/pyramid/etc. >> >> pylons-discuss >> - General disc

Re: ATTN: Please keep general discussion on pylons-discuss

2011-03-31 Thread Ben Bangert
On Mar 31, 2011, at 7:14 AM, Chris Withers wrote: > How about just merging the lists? As far as I know, Google Groups has no 'merge' option. > Is there really so much volume as to justify two lists? Well, the -devel is intentionally lower traffic so those more concerned about the development o

Re: requests and transactions

2011-03-31 Thread Chris Withers
On 31/03/2011 17:17, Chris McDonough wrote: Related: Any chance of a RequestFinished event to subscribe to rather than having to (rather convolutedly) subscribe to NewRequest just so your handler can call add_finished_callback? ...in which case, I'd dearly love that RequestFinished event! Roc

Re: requests and transactions

2011-03-31 Thread Chris McDonough
On Thu, 2011-03-31 at 16:49 +0100, Chris Withers wrote: > On 31/03/2011 16:09, Chris Withers wrote: > > What's the preferred way of working with transactions now, be they just > > SQLAlchemy transactions or, more likely, a bunch of things tied together > > by a transaction from the 'transaction' pa

Re: requests and transactions

2011-03-31 Thread Chris Withers
On 31/03/2011 16:09, Chris Withers wrote: What's the preferred way of working with transactions now, be they just SQLAlchemy transactions or, more likely, a bunch of things tied together by a transaction from the 'transaction' package? repoze.tm2 seems to be the "old skool" BFG way of doing thin

Re: requests and transaction (was Re: request lifecycle)

2011-03-31 Thread Daniel Holth
In other words you can probably get most of the same events by subclassing one of the deprecated classes. That SQLAlchemy has such low release numbers, and it's written by that scofflaw M. Bayer. Nobody should use it until 1.0, he should stick to directing Hollywood blockbusters. ;-) -- You r

Re: requests and transaction (was Re: request lifecycle)

2011-03-31 Thread Chris Withers
On 31/03/2011 16:18, Daniel Holth wrote: SQLAlchemy 0.7 deprecates SessionExtension() and other abstract base classes and replaces them with an event interface. This doesn't address any of the reasons why I re-named the thread ;-) Until 0.7 is officially released, I won't be using it... cheer

Re: requests and transaction (was Re: request lifecycle)

2011-03-31 Thread Daniel Holth
SQLAlchemy 0.7 deprecates SessionExtension() and other abstract base classes and replaces them with an event interface. -- You received this message because you are subscribed to the Google Groups "pylons-devel" group. To post to this group, send email to pylons-devel@googlegroups.com. To unsubs

Re: request lifecycle

2011-03-31 Thread Daniel Holth
transaction manager - calls -> repoze.bfg^Wpyramid -> your view Your view returns, pyramid pops the threadlocal context used by get_current_request, and then the transaction manager commits. You can't get the threadlocal request anymore because Pyramid has already done its cleanup and popped the

requests and transaction (was Re: request lifecycle)

2011-03-31 Thread Chris Withers
On 31/03/2011 16:00, Daniel Nouri wrote: On Thu, Mar 31, 2011 at 4:44 PM, Chris Withers wrote: On 31/03/2011 15:40, Daniel Nouri wrote: FWIW, get_current_request() works with 'before_insert' and 'before_update' events. I don't see these listed here: http://www.sqlalchemy.org/docs/orm/interf

Re: request lifecycle

2011-03-31 Thread Daniel Nouri
On Thu, Mar 31, 2011 at 4:44 PM, Chris Withers wrote: > On 31/03/2011 15:40, Daniel Nouri wrote: >> FWIW, get_current_request() works with 'before_insert' and >> 'before_update' events. > > I don't see these listed here: > > http://www.sqlalchemy.org/docs/orm/interfaces.html?highlight=sessionexten

Re: request lifecycle

2011-03-31 Thread Chris Withers
On 31/03/2011 15:40, Daniel Nouri wrote: On Thu, Mar 31, 2011 at 4:23 PM, Chris Withers wrote: Hi All, I'm using zope.sqlalchemy to commit a a SQLAlchemy session. As part of that commit, I want to record the user making the change as an attribute of the changed object. To do this, in a Sessio

Re: request lifecycle

2011-03-31 Thread Daniel Nouri
On Thu, Mar 31, 2011 at 4:23 PM, Chris Withers wrote: > Hi All, > > I'm using zope.sqlalchemy to commit a a SQLAlchemy session. > As part of that commit, I want to record the user making the change as an > attribute of the changed object. > > To do this, in a SessionExtension's before_flush method

request lifecycle

2011-03-31 Thread Chris Withers
Hi All, I'm using zope.sqlalchemy to commit a a SQLAlchemy session. As part of that commit, I want to record the user making the change as an attribute of the changed object. To do this, in a SessionExtension's before_flush method I do: user_id = authenticated_userid(get_current_request())

Re: ATTN: Please keep general discussion on pylons-discuss

2011-03-31 Thread Chris Withers
On 15/03/2011 20:01, Ben Bangert wrote: Here's a quick way to know which one to post to: pylons-devel - Discussion about development of pylons project libraries such as pylons/pyramid/etc. pylons-discuss - General discussion about best practices of development, asking for help, etc. How about