Re: [sqlalchemy] object “is already present in this session” when using a new session with older objects

2020-12-07 Thread Vinit Shah
Ah! I found it. In the classical mapping in the example, I forgot to set inherits=True. Upgrading to 1.4.0b1 solved the other issues for me. On Friday, December 4, 2020 at 11:27:57 AM UTC-5 Vinit Shah wrote: > > Thanks both Mike and Simon for the input! Apologies for the late reply,

Re: [sqlalchemy] object “is already present in this session” when using a new session with older objects

2020-12-04 Thread Vinit Shah
u > get an error. > > The easiest solution would be to create a session-specific copy of > typeDict, either by re-querying from the database, or by using > session.merge with load=False. > > Hope that helps, > > Simon > > On Thu, Nov 19, 2020 at 11:16 PM Vinit Shah w

[sqlalchemy] object “is already present in this session” when using a new session with older objects

2020-11-19 Thread Vinit Shah
I posted this on StackOverflow a few days ago, but I haven't been able to figure this one out yet. The original post can be found here: StackOverflow: object "is already present in this session"

Re: [sqlalchemy] StaleDataError when accessing a relationship attribute

2019-08-17 Thread Vinit Shah
Thanks for the quick reply. That makes sense. I ended up going with doing a series of joins and 'contains_eager' calls for all relationship attributes I knew I'd need to access. -- SQLAlchemy - The Python SQL Toolkit and Object Relational Mapper http://www.sqlalchemy.org/ To post example

[sqlalchemy] Re: StaleDataError when accessing a relationship attribute

2019-08-16 Thread Vinit Shah
if another processes has updated game as well session.add(game) Running the above code at the same time results in the consistent StaleDataError On Friday, August 16, 2019 at 2:18:05 PM UTC-4, Vinit Shah wrote: > > I have code that looks like the following: > > games = session.query(

[sqlalchemy] StaleDataError when accessing a relationship attribute

2019-08-16 Thread Vinit Shah
I have code that looks like the following: games = session.query(Game) game = [g for g in games][0] court = game.court # StaleDataError game. session.add(game) Game looks like: class Game(Base): __tablename__ = "Games" id = Column(Integer, primary_key=True) courtId =

[sqlalchemy] Hanging on _get_constraint_data with schema of type unicode

2018-06-21 Thread Vinit Shah
I've posted this on stackoverflow , but I may have more luck here. I'm using SqlAlchemy's autoload feature to load up table data. Recently, after an upgrade to Oracle