Re: [sqlalchemy] SQLAlchemy transaction ID

2021-01-27 Thread 'Jonathan Vanasco' via sqlalchemy
FWIW, within the realm of pyramid_tm, the more common use-cases for two-phase transaction support are for sending mail and a dealing with task queues - not two separate databases. On Wednesday, January 27, 2021 at 2:40:21 PM UTC-5 Mike Bayer wrote: > > > On Wed, Jan 27, 2021, at 2:23 PM,

Re: [sqlalchemy] FAQ or Feature Ideas for ORM Object and Session

2021-01-27 Thread 'Jonathan Vanasco' via sqlalchemy
Ok. I'll generate a docs PR for sqlalchemy and pyramid. this comes up so much. On Wednesday, January 27, 2021 at 2:25:29 PM UTC-5 Mike Bayer wrote: > > > On Wed, Jan 27, 2021, at 1:12 PM, 'Jonathan Vanasco' via sqlalchemy wrote: > > I've been working with a handful of SQLAlchemy and Pyramid

Re: [sqlalchemy] mapper on a temporary class

2021-01-27 Thread Kent Bower
Excellent. As always, thanks very much for your time and answers (let alone awesome software)! On Wed, Jan 27, 2021 at 1:25 PM Mike Bayer wrote: > > > On Tue, Jan 26, 2021, at 9:01 PM, Kent Bower wrote: > > Thanks a ton for your responses. > > Do all the normal columns of an aliased class

Re: [sqlalchemy] SQLAlchemy transaction ID

2021-01-27 Thread Mike Bayer
On Wed, Jan 27, 2021, at 2:23 PM, Thierry Florac wrote: > Hi, > I'm actually using two databases connections: one is my "main" connection, > opened on a ZODB (with RelStorage), and **sometimes** I have to open another > connection on another database (and event more sometimes); the two >

Re: [sqlalchemy] FAQ or Feature Ideas for ORM Object and Session

2021-01-27 Thread Mike Bayer
On Wed, Jan 27, 2021, at 1:12 PM, 'Jonathan Vanasco' via sqlalchemy wrote: > I've been working with a handful of SQLAlchemy and Pyramid based projects > recently, and two situations have repeatedly come up: > > 1. Given a SQLAlchemy Object, access the SQLAlchemy Session > 2. Given a SQLAlchemy

Re: [sqlalchemy] SQLAlchemy transaction ID

2021-01-27 Thread Thierry Florac
Hi, I'm actually using two databases connections: one is my "main" connection, opened on a ZODB (with RelStorage), and **sometimes** I have to open another connection on another database (and event more sometimes); the two transactions have to be synchronized: if one of them is aborted for any

Re: [sqlalchemy] mapper on a temporary class

2021-01-27 Thread Mike Bayer
On Tue, Jan 26, 2021, at 9:01 PM, Kent Bower wrote: > Thanks a ton for your responses. > > Do all the normal columns of an aliased class need to match the ad-hoc select > to which I map the alias? handwavy handwavy sort of yes, sort of no?there needs to be a 1-1 correspondence of

Re: [sqlalchemy] SQLAlchemy transaction ID

2021-01-27 Thread Mike Bayer
On Wed, Jan 27, 2021, at 8:32 AM, Thierry Florac wrote: > > Hi, > I'm actually using SQLAlchemy with Pyramid and zope.sqlalchemy packages. > My main database connection is a ZODB connection and, when required, I create > an SQLAlchemy session which is joined to main transaction using this kind

[sqlalchemy] FAQ or Feature Ideas for ORM Object and Session

2021-01-27 Thread 'Jonathan Vanasco' via sqlalchemy
I've been working with a handful of SQLAlchemy and Pyramid based projects recently, and two situations have repeatedly come up: 1. Given a SQLAlchemy Object, access the SQLAlchemy Session 2. Given a SQLAlchemy Object or Session, access the Pyramid Request object The general solutions I've used

[sqlalchemy] Re: SQLAlchemy transaction ID

2021-01-27 Thread 'Jonathan Vanasco' via sqlalchemy
Thierry, Would you mind putting together a test-case on this? I haven't experienced that before, and I authored that feature in the debugtoolbar. If I can recreate it, I'll put together a fix and work with the pyramid team to get a new release out asap. On Wednesday, January 27, 2021 at

[sqlalchemy] SQLAlchemy transaction ID

2021-01-27 Thread Thierry Florac
Hi, I'm actually using SQLAlchemy with Pyramid and zope.sqlalchemy packages. My main database connection is a ZODB connection and, when required, I create an SQLAlchemy session which is joined to main transaction using this kind of code: from sqlalchemy.orm import scoped_session, sessionmaker